<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: The field is not nullable with spatially enabled data frame in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/the-field-is-not-nullable-with-spatially-enabled/m-p/1269070#M66819</link>
    <description>&lt;P&gt;This is a suboptimal and late answer, but you can always use Pandas' &lt;A href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.fillna.html" target="_self"&gt;.fillna()&lt;/A&gt; method on the SEDF prior to exporting, which replaces nulls with a value of your choice. You can apply to single columns or to an entire dataframe.&lt;/P&gt;&lt;P&gt;Obviously this is suboptimal because as you said, sometimes you want nulls, but this is useful for some cases.&lt;/P&gt;&lt;P&gt;Also, if you found a *real* solution please post!&lt;/P&gt;</description>
    <pubDate>Fri, 17 Mar 2023 18:19:16 GMT</pubDate>
    <dc:creator>DarrenConly</dc:creator>
    <dc:date>2023-03-17T18:19:16Z</dc:date>
    <item>
      <title>The field is not nullable with spatially enabled data frame</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/the-field-is-not-nullable-with-spatially-enabled/m-p/162599#M7369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a process where I am making use of spatially enabled data frames, and I wish to drop my dataframe back to a geodatabase (or shapefile).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is occuring, however, is that I receive the below error message. It seems as though I am having some difficulty writing to a geodatabase (and shapefile, but that's a known issue with nulls) when my dataframe contains null values. Because I've got 50+ columns, and potentially 500,000+ rows, I do not wish to be replacing nulls. In fact, many of those nulls exist with good reason.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, Has anyone seen this before? Is there a flag that I've missed in the documentation that will allow any field being written to permit nulls (where it might be set to notnullable by default)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt; File "&amp;lt;string&amp;gt;", line 272, in execute&lt;BR /&gt; File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\geo\_accessor.py", line 2074, in to_featureclass&lt;BR /&gt; has_m=has_m)&lt;BR /&gt; File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\geo\_io\fileops.py", line 688, in to_featureclass&lt;BR /&gt; np.apply_along_axis(_insert_row, 1, df[dfcols].values)&lt;BR /&gt; File "&amp;lt;__array_function__ internals&amp;gt;", line 6, in apply_along_axis&lt;BR /&gt; File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\numpy\lib\shape_base.py", line 379, in apply_along_axis&lt;BR /&gt; res = asanyarray(func1d(inarr_view[ind0], *args, **kwargs))&lt;BR /&gt; File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\geo\_io\fileops.py", line 685, in _insert_row&lt;BR /&gt; irows.insertRow(row)&lt;BR /&gt;RuntimeError: The field is not nullable. [re_id]&lt;BR /&gt; Failed to execute (Tool).&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the offending piece of code:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;#Create file path variable for the Regional Ecosystem 80th Percentile Fuel Lookup Table&lt;BR /&gt; messages.addMessage("Loading RE Fuel data csv to dataframe")&lt;BR /&gt; inTableREp = parameters[3].valueAsText&lt;BR /&gt; dfRELUT = pd.read_csv(inTableREp) &lt;BR /&gt; messages.addMessage("Successfully Read: " + inTableREp)&lt;BR /&gt; messages.addMessage(dfRELUT.head())&lt;BR /&gt; messages.addMEssage(dfRELUT.dtypes)&lt;BR /&gt;&lt;BR /&gt; #Read Pre-Clear Shapefile &lt;BR /&gt; messages.addMessage("Reading PreClear Veg table to spatially enabled dataframe") &lt;BR /&gt; dfPreClearVeg = pd.DataFrame.spatial.from_featureclass(tmpPreClearAOI)&lt;BR /&gt; messages.addMessage("Successfully Read: " + tmpPreClearAOI)&lt;BR /&gt; messages.addMessage(dfPreClearVeg.head())&lt;BR /&gt; messages.addMEssage(dfPreClearVeg.dtypes)&lt;BR /&gt;&lt;BR /&gt; #Merge the datframes together&lt;BR /&gt; messages.addMessage("Joining PreClear df RE1 with RE Fuel Lookup Table") &lt;BR /&gt; left_merged = dfPreClearVeg.join(&lt;BR /&gt; dfRELUT.set_index(["RE"]),&lt;BR /&gt; lsuffix="",&lt;BR /&gt; rsuffix="_lut",&lt;BR /&gt; on=["RE1"],&lt;BR /&gt; )&lt;/P&gt;&lt;P&gt;messages.addMessage(left_merged.head())&lt;BR /&gt; messages.addMessage(left_merged.shape)&lt;BR /&gt; messages.addMEssage(left_merged.dtypes)&lt;/P&gt;&lt;P&gt;left_merged.spatial.to_featureclass(location=temp_gdb) #Bombs out here&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Sep 2020 04:49:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/the-field-is-not-nullable-with-spatially-enabled/m-p/162599#M7369</guid>
      <dc:creator>SimonWebster</dc:creator>
      <dc:date>2020-09-01T04:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: The field is not nullable with spatially enabled data frame</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/the-field-is-not-nullable-with-spatially-enabled/m-p/162600#M7370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The thing that slays me is that ESRIs own example data on the Introduction to Spatially Enabled Dataframes actually has null values in it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jivelink1" href="https://developers.arcgis.com/python/guide/introduction-to-the-spatially-enabled-dataframe/" title="https://developers.arcgis.com/python/guide/introduction-to-the-spatially-enabled-dataframe/"&gt;https://developers.arcgis.com/python/guide/introduction-to-the-spatially-enabled-dataframe/&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Sep 2020 05:44:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/the-field-is-not-nullable-with-spatially-enabled/m-p/162600#M7370</guid>
      <dc:creator>SimonWebster</dc:creator>
      <dc:date>2020-09-01T05:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: The field is not nullable with spatially enabled data frame</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/the-field-is-not-nullable-with-spatially-enabled/m-p/1050574#M40126</link>
      <description>&lt;P&gt;Same problem here! Did you find the solution?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 11:05:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/the-field-is-not-nullable-with-spatially-enabled/m-p/1050574#M40126</guid>
      <dc:creator>Jose_FranciscoSánchez_Díaz1</dc:creator>
      <dc:date>2021-04-23T11:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: The field is not nullable with spatially enabled data frame</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/the-field-is-not-nullable-with-spatially-enabled/m-p/1269070#M66819</link>
      <description>&lt;P&gt;This is a suboptimal and late answer, but you can always use Pandas' &lt;A href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.fillna.html" target="_self"&gt;.fillna()&lt;/A&gt; method on the SEDF prior to exporting, which replaces nulls with a value of your choice. You can apply to single columns or to an entire dataframe.&lt;/P&gt;&lt;P&gt;Obviously this is suboptimal because as you said, sometimes you want nulls, but this is useful for some cases.&lt;/P&gt;&lt;P&gt;Also, if you found a *real* solution please post!&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 18:19:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/the-field-is-not-nullable-with-spatially-enabled/m-p/1269070#M66819</guid>
      <dc:creator>DarrenConly</dc:creator>
      <dc:date>2023-03-17T18:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: The field is not nullable with spatially enabled data frame</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/the-field-is-not-nullable-with-spatially-enabled/m-p/1374166#M77881</link>
      <description>&lt;P&gt;I'm having the same problem. I'd rather not fill my null values, I prefer null to spaces or other fillers. I'm going to submit an idea in ArcGIS Ideas.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2024 21:56:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/the-field-is-not-nullable-with-spatially-enabled/m-p/1374166#M77881</guid>
      <dc:creator>KellyTaylor</dc:creator>
      <dc:date>2024-01-24T21:56:02Z</dc:date>
    </item>
  </channel>
</rss>

