<?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: cannot change field alias without changing field name in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/cannot-change-field-alias-without-changing-field/m-p/529701#M41489</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reminds me of the protracted discussions about &lt;A _jive_internal="true" href="https://community.esri.com/groups/dan-patterson-test/blog/2016/01/01/before-i-forget-5-that-empty-feeling"&gt;what is None&lt;/A&gt; and the many links therein....there is only one None...everything is just an 'empty' wannabe &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 05 Feb 2017 17:52:57 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2017-02-05T17:52:57Z</dc:date>
    <item>
      <title>cannot change field alias without changing field name</title>
      <link>https://community.esri.com/t5/python-questions/cannot-change-field-alias-without-changing-field/m-p/529697#M41485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to change the field alias in a feature class in a file gdb (and eventually in SDE). The alterfield_management syntax indicates I can do this, however, I get a syntax error when I try.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE class="" style="color: #4d4d4d; background-color: #fefefe; font-size: 0.75em; margin-bottom: 1.5em;"&gt;AlterField_management(fc, 'Sign_repai',, 'Sign Repair')&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It seems to not like the fact that I skipped the 3rd parameter.&lt;/P&gt;&lt;P&gt;All of the parameters except for the first two are supposed to optional.&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE class="language-python" style="color: #4d4d4d; background-color: #fefefe; font-size: 0.75em; margin-bottom: 1.5em;"&gt;&lt;CODE&gt;AlterField_management &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_table&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;new_field_name&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;new_field_alias&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;field_type&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;field_length&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;field_is_nullable&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;clear_field_alias&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;If I use the existing name as the "new field name" and then set a new alias name it works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is the documentation incorrect? Or should I be doing something else?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Feb 2017 04:49:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-change-field-alias-without-changing-field/m-p/529697#M41485</guid>
      <dc:creator>MikeOnzay</dc:creator>
      <dc:date>2017-02-04T04:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: cannot change field alias without changing field name</title>
      <link>https://community.esri.com/t5/python-questions/cannot-change-field-alias-without-changing-field/m-p/529698#M41486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The way to call it if you want to exclude the &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;new_field_name&lt;/SPAN&gt; argument is:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;AlterField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Sign_repai'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; new_field_alias&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Sign Repair'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The documentation is correct, you are running into expected behavior.&amp;nbsp; In Python when passing optional arguments by position, instead of by keyword/name, all arguments to the left of the optional argument must be present.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;arg_pass&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;required&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; optional1&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;None&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; optional2&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;None&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;pass&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; arg_pass&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'some text'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'more text'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'even more text'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; arg_pass&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'some text'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'even more text'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
Parsing error SyntaxError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; invalid syntax &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;line &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; arg_pass&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'some text'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; optional2&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'even more text'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; ‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&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;&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;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:04:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-change-field-alias-without-changing-field/m-p/529698#M41486</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-11T23:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: cannot change field alias without changing field name</title>
      <link>https://community.esri.com/t5/python-questions/cannot-change-field-alias-without-changing-field/m-p/529699#M41487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As Joshua pointed out, you can't just skip parameters without providing an appropriate substitute.&amp;nbsp; Unfortunately, many/most of the tools in ArcMap don't show what the default is,&amp;nbsp; maybe '#', or None, but in any event, to make your life easier, just used the named syntax ( ie this_parameter='Some_Value')&amp;nbsp; The added advantage of using named parameters is you can specify then in any order you want, but! you can't mix named and in-named parameters once you have started down one of those two paths.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Feb 2017 16:42:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-change-field-alias-without-changing-field/m-p/529699#M41487</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-02-04T16:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: cannot change field alias without changing field name</title>
      <link>https://community.esri.com/t5/python-questions/cannot-change-field-alias-without-changing-field/m-p/529700#M41488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dan, I agree, passing by keyword/name for optional parameters is easier and more consistent with the rest of the Python world.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Your comment got me thinking, though, so I decided to take another look at the documentation.&amp;nbsp; Tucked away in the &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/executing-tools/executing-tools-at-the-python-window.htm#GUID-1100577F-3E71-464E-84D9-72E6D269D52D"&gt;Default values&lt;/A&gt; section of&amp;nbsp;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/executing-tools/executing-tools-at-the-python-window.htm#GUID-837589BF-A3D7-47FF-8305-0087E2E7D804"&gt;Executing tools in the Python window,&lt;/A&gt; it states:&lt;/P&gt;&lt;UL style="padding: 0px; color: #4d4d4d; text-transform: none; line-height: 1.71em; text-indent: 0px; letter-spacing: normal; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif; font-size: 0.87em; font-style: normal; font-weight: normal; margin-top: 0px; margin-bottom: 1.5em; word-spacing: 0px; list-style-type: none; list-style-position: inside; white-space: normal; orphans: 2; widows: 2; background-color: #fefefe; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px;"&gt;&lt;LI style="padding-left: 1em; font-size: 0.87rem; position: relative; -webkit-font-smoothing: antialiased;"&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;Optional parameters have default values. If you enter a quoted&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas, 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-weight: bold; -webkit-font-smoothing: antialiased;"&gt;#&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(pound sign),&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas, 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-weight: bold; -webkit-font-smoothing: antialiased;"&gt;""&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(two double quotation marks),&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas, 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-weight: bold; -webkit-font-smoothing: antialiased;"&gt;''&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(two single quotation marks), or a Python&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas, 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-weight: bold; -webkit-font-smoothing: antialiased;"&gt;None&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;for an optional parameter, the default parameter value will be used. For keywords, the default value is the first keyword in the list. See the help for an individual tool for its default parameter values.&lt;/BLOCKQUOTE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;It appears there are four valid options, sort of like Choose Your Own Adventure for optional parameters.&amp;nbsp; Personally, this just feels like a recipe for disaster, or at least headache.&amp;nbsp;&amp;nbsp;With it's handling of optional parameters, Esri is strongly violating&amp;nbsp;&lt;A href="https://www.python.org/dev/peps/pep-0020/"&gt;The Zen of Python &lt;/A&gt;notion "there should be one-- and preferably only one --obvious way to do it."&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Feb 2017 15:07:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-change-field-alias-without-changing-field/m-p/529700#M41488</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-02-05T15:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: cannot change field alias without changing field name</title>
      <link>https://community.esri.com/t5/python-questions/cannot-change-field-alias-without-changing-field/m-p/529701#M41489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reminds me of the protracted discussions about &lt;A _jive_internal="true" href="https://community.esri.com/groups/dan-patterson-test/blog/2016/01/01/before-i-forget-5-that-empty-feeling"&gt;what is None&lt;/A&gt; and the many links therein....there is only one None...everything is just an 'empty' wannabe &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Feb 2017 17:52:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-change-field-alias-without-changing-field/m-p/529701#M41489</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-02-05T17:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: cannot change field alias without changing field name</title>
      <link>https://community.esri.com/t5/python-questions/cannot-change-field-alias-without-changing-field/m-p/529702#M41490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Although not Zen, I agree with Dan that using "#" is acceptable, since it goes way back to the AML days (i.e. '80s" anyway).&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;arcpy.AlterField_management(r'C:\__temp\test.gdb\newpts', "POINT_X", "#", "myX")&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;In commands, if I need to use the default or not change a value, I try "X" first, if that doesn't work ""&amp;nbsp; (i.e. double, empty quotes) sometimes works too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="315950" alt="" class="image-1 jive-image" height="499" src="https://community.esri.com/legacyfs/online/315950_pastedImage_1.png" width="412" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Feb 2017 16:11:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-change-field-alias-without-changing-field/m-p/529702#M41490</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2017-02-06T16:11:01Z</dc:date>
    </item>
  </channel>
</rss>

