Skip to content

Commit

Permalink
Remove more debug logging within loops
Browse files Browse the repository at this point in the history
  • Loading branch information
sgillies committed Jun 2, 2022
1 parent 556bc81 commit ff313b3
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions fiona/ogrext.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,13 @@ cdef void* gdal_open_vector(char* path_c, int mode, drivers, options) except NUL
drvs = CSLAddString(drvs, name_c)

for k, v in options.items():

if v is None:
continue

k = k.upper().encode('utf-8')
if isinstance(v, bool):
v = ('ON' if v else 'OFF').encode('utf-8')
else:
v = str(v).encode('utf-8')
log.debug("Set option %r: %r", k, v)
open_opts = CSLAddNameValue(open_opts, <const char *>k, <const char *>v)

open_opts = CSLAddNameValue(open_opts, "VALIDATE_OPEN_OPTIONS", "NO")
Expand Down Expand Up @@ -156,7 +153,6 @@ cdef void* gdal_create(void* cogr_driver, const char *path_c, options) except NU
v = ('ON' if v else 'OFF').encode('utf-8')
else:
v = str(v).encode('utf-8')
log.debug("Set option %r: %r", k, v)
creation_opts = CSLAddNameValue(creation_opts, <const char *>k, <const char *>v)

try:
Expand Down Expand Up @@ -1156,7 +1152,6 @@ cdef class WritingSession(Session):
v = ('ON' if v else 'OFF').encode('utf-8')
else:
v = str(v).encode('utf-8')
log.debug("Set option %r: %r", k, v)
options = CSLAddNameValue(options, <const char *>k, <const char *>v)

geometry_type = collection.schema.get("geometry", "Unknown")
Expand Down Expand Up @@ -1213,9 +1208,6 @@ cdef class WritingSession(Session):
before_fields.update(new_fields)

for key, value in new_fields.items():

log.debug("Begin creating field: %r value: %r", key, value)

field_subtype = OFSTNone

# Convert 'long' to 'int'. See
Expand All @@ -1234,8 +1226,6 @@ cdef class WritingSession(Session):
if ':' in value:
value, fmt = value.split(':')

log.debug("Field format parsing, value: %r, fmt: %r", value, fmt)

if '.' in fmt:
width, precision = map(int, fmt.split('.'))
else:
Expand Down Expand Up @@ -1269,7 +1259,6 @@ cdef class WritingSession(Session):

else:
OGR_Fld_Destroy(cogr_fielddefn)
log.debug("End creating field %r", key)

# Mapping of the Python collection schema to the munged
# OGR schema.
Expand Down Expand Up @@ -1307,9 +1296,8 @@ cdef class WritingSession(Session):
raise TransactionError("Failed to start transaction")

schema_props_keys = set(collection.schema['properties'].keys())
for record in records:
log.debug("Creating feature in layer: %s" % record)

for record in records:
# Check for optional elements
if 'properties' not in record:
record['properties'] = {}
Expand Down Expand Up @@ -1368,7 +1356,6 @@ cdef class WritingSession(Session):
if cogr_ds == NULL:
raise ValueError("Null data source")


gdal_flush_cache(cogr_ds)
log.debug("Flushed data source cache")

Expand Down

0 comments on commit ff313b3

Please sign in to comment.