<?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>idea Make 'sanitize_columns=True' an optional parameter on the Python API SEDF in ArcGIS API for Python Ideas</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-ideas/make-sanitize-columns-true-an-optional-parameter/idi-p/1068385</link>
    <description>&lt;P&gt;The Spatially Enabled Dataframe has a .to_featurelayer() method which allows users to easily publish a feature service from a Spatially Enabled Dataframe. It's a great, long desired capability with really only one shortcoming that I can find.&lt;/P&gt;&lt;P&gt;The SEDF's .to_featurelayer() method has the unfortunate behavior of sanitizing column names, even if the column names are valid to begin with.&lt;/P&gt;&lt;P&gt;The result is that its changes column names from their original case to snake_case. For example 'storeName' gets changed to 'store_name' when you utilize the .to_featurelayer() method to publish the data frame as a feature layer, even though there is absolutely nothing invalid at all about a feature layer with a field named 'storeName'.&lt;/P&gt;&lt;P&gt;Interestingly however, the .to_featureclass() method exposes a sanitize_columns parameter which is defaulted to True. Meaning you can set that parameter to False on the .to_featureclass() method to avoid this behavior, but for whatever reason this parameter wasn't exposed on the .to_featurelayer() method.&lt;/P&gt;&lt;P&gt;Please expose a 'sanitize_columns' parameter on the SEDF's .to_featurelayer() method so that we can disable this feature if we so desire. Like the SEDF's .to_featureclass method, the 'sanitize_columns' parameter can be defaulted to True to avoid an unexpected change in behavior for users who might already be using this.&lt;/P&gt;</description>
    <pubDate>Tue, 15 Jun 2021 14:54:45 GMT</pubDate>
    <dc:creator>JohnMDye</dc:creator>
    <dc:date>2021-06-15T14:54:45Z</dc:date>
    <item>
      <title>Make 'sanitize_columns=True' an optional parameter on the Python API SEDF</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-ideas/make-sanitize-columns-true-an-optional-parameter/idi-p/1068385</link>
      <description>&lt;P&gt;The Spatially Enabled Dataframe has a .to_featurelayer() method which allows users to easily publish a feature service from a Spatially Enabled Dataframe. It's a great, long desired capability with really only one shortcoming that I can find.&lt;/P&gt;&lt;P&gt;The SEDF's .to_featurelayer() method has the unfortunate behavior of sanitizing column names, even if the column names are valid to begin with.&lt;/P&gt;&lt;P&gt;The result is that its changes column names from their original case to snake_case. For example 'storeName' gets changed to 'store_name' when you utilize the .to_featurelayer() method to publish the data frame as a feature layer, even though there is absolutely nothing invalid at all about a feature layer with a field named 'storeName'.&lt;/P&gt;&lt;P&gt;Interestingly however, the .to_featureclass() method exposes a sanitize_columns parameter which is defaulted to True. Meaning you can set that parameter to False on the .to_featureclass() method to avoid this behavior, but for whatever reason this parameter wasn't exposed on the .to_featurelayer() method.&lt;/P&gt;&lt;P&gt;Please expose a 'sanitize_columns' parameter on the SEDF's .to_featurelayer() method so that we can disable this feature if we so desire. Like the SEDF's .to_featureclass method, the 'sanitize_columns' parameter can be defaulted to True to avoid an unexpected change in behavior for users who might already be using this.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 14:54:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-ideas/make-sanitize-columns-true-an-optional-parameter/idi-p/1068385</guid>
      <dc:creator>JohnMDye</dc:creator>
      <dc:date>2021-06-15T14:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Make 'sanitize_columns=True' an optional parameter on the Python API SEDF</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-ideas/make-sanitize-columns-true-an-optional-parameter/idc-p/1109925#M38</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/337472"&gt;@JohnMDye&lt;/a&gt;thanks for this idea. The Python API team is considering this along with other ideas shared at &lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/i-m-done-with-spatially-enabled-dataframes/m-p/1026149" target="_blank"&gt;https://community.esri.com/t5/arcgis-api-for-python-questions/i-m-done-with-spatially-enabled-dataframes/m-p/1026149&lt;/A&gt; and &lt;A href="https://github.com/Esri/arcgis-python-api/issues/923" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/Esri/arcgis-python-api/issues/923&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;In the upcoming v2.0 release, we are taking a broader look at IO operations on SeDF and plan to expose this at all appropriate operations. We also plan to switch the sanitizer to default to False. We also plan to make the sanitizer not mutate the original column names or indices of the calling DataFrame object. You can track the progress on &lt;A href="https://github.com/Esri/arcgis-python-api/issues/923" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/Esri/arcgis-python-api/issues/923&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Oct 2021 20:00:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-ideas/make-sanitize-columns-true-an-optional-parameter/idc-p/1109925#M38</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-10-21T20:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: Make 'sanitize_columns=True' an optional parameter on the Python API SEDF - Status changed to: Under Consideration</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-ideas/make-sanitize-columns-true-an-optional-parameter/idc-p/1109936#M39</link>
      <description />
      <pubDate>Thu, 21 Oct 2021 20:20:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-ideas/make-sanitize-columns-true-an-optional-parameter/idc-p/1109936#M39</guid>
      <dc:creator>ShaunWalbridge</dc:creator>
      <dc:date>2021-10-21T20:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: Make 'sanitize_columns=True' an optional parameter on the Python API SEDF</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-ideas/make-sanitize-columns-true-an-optional-parameter/idc-p/1191153#M40</link>
      <description>&lt;P&gt;It would be good to change the sanitize method to NFKD.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;import unicodedata&lt;BR /&gt;import re&lt;BR /&gt;def &lt;/SPAN&gt;&lt;SPAN&gt;sanitize&lt;/SPAN&gt;(string: &lt;SPAN&gt;str&lt;/SPAN&gt;) -&amp;gt; &lt;SPAN&gt;str&lt;/SPAN&gt;:&lt;BR /&gt;    &lt;SPAN&gt;"""&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    Remove especial char, ie: "é" becomes "e"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    :param string: string to be sanitized&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    :return: sanitized string&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    """&lt;BR /&gt;&lt;/SPAN&gt;    str_value = string&lt;BR /&gt;    &lt;SPAN&gt;if &lt;/SPAN&gt;&lt;SPAN&gt;isinstance&lt;/SPAN&gt;(str_value&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;str&lt;/SPAN&gt;):&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;        nfkd_form = unicodedata.normalize(&lt;SPAN&gt;'NFKD'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;str_value)&lt;BR /&gt;        str_value = &lt;SPAN&gt;u""&lt;/SPAN&gt;.join([c &lt;SPAN&gt;for &lt;/SPAN&gt;c &lt;SPAN&gt;in &lt;/SPAN&gt;nfkd_form &lt;SPAN&gt;if not &lt;/SPAN&gt;unicodedata.combining(c)])&lt;BR /&gt;        str_value = re.sub(&lt;SPAN&gt;r'&lt;/SPAN&gt;&lt;SPAN&gt;[^A-Za-z0-9]&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'_'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;(str_value))&lt;BR /&gt;    &lt;SPAN&gt;return &lt;/SPAN&gt;str_value&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;sanitize("colum a")&lt;BR /&gt;Out[14]: 'colum_a'&lt;BR /&gt;&lt;BR /&gt;sanitize("@gps")&lt;BR /&gt;Out[15]: '_gps'&lt;BR /&gt;&lt;BR /&gt;sanitize("résumé.a")&lt;BR /&gt;Out[16]: 'resume_a'&lt;BR /&gt;&lt;BR /&gt;sanitize("Naïve")&lt;BR /&gt;Out[17]: 'Naive'&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;The current sanitize method is to aggressive in my opinion. I Hardly use it.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Jul 2022 15:42:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-ideas/make-sanitize-columns-true-an-optional-parameter/idc-p/1191153#M40</guid>
      <dc:creator>HildermesJoséMedeirosFilho</dc:creator>
      <dc:date>2022-07-10T15:42:50Z</dc:date>
    </item>
  </channel>
</rss>

