The title says is all. I'd appreciate being able to maintain null values when converting a SeDF to a featureclass in a gdb. I've used pandas.fillna() with fillers like a space before, but sometimes a null value is there for a reason, and I'd prefer to leave it null.
Yes please. It currently exports as empty strings (for text fields). Here is a link to the issue and current feedback: github
I agree that this needs to be changed. Its another instance of the tool changing values when not explicitly defined (sanitize_columns was another instance of this). arcpy ExportFeatures/Table honors null values but its hit and miss with executing successfully.
Another workaround our team has utilized is to calculate values with the Calculate Field tool after using to_featureclass.
string_fields = [f.name for f in arcpy.ListFields(<fc>) if f.type == 'String']
for i in string_fields:
arcpy.management.CalculateField(
in_table=<fc>,
field=i,
expression=f"None if !{i}! == '' else !{i}!",
expression_type="PYTHON3",
code_block="",
field_type="TEXT",
enforce_domains="NO_ENFORCE_DOMAINS"
)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.