<?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: TypeError: encode() on calling named_object_type_adds (Enterprise 11.3, ArcGIS Python API 2.4.0) in ArcGIS Knowledge Questions</title>
    <link>https://community.esri.com/t5/arcgis-knowledge-questions/typeerror-encode-on-calling-named-object-type-adds/m-p/1557605#M100</link>
    <description>&lt;P&gt;Hello, we recently discovered and fixed this bug which prevents data model (schema) editing specifically when the python script is run in a Linux environment. It will be fixed in the next release of the Python API so the workaround would be to use an older version for now.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Nov 2024 16:33:43 GMT</pubDate>
    <dc:creator>MeganBanaski1</dc:creator>
    <dc:date>2024-11-12T16:33:43Z</dc:date>
    <item>
      <title>TypeError: encode() on calling named_object_type_adds (Enterprise 11.3, ArcGIS Python API 2.4.0)</title>
      <link>https://community.esri.com/t5/arcgis-knowledge-questions/typeerror-encode-on-calling-named-object-type-adds/m-p/1556782#M99</link>
      <description>&lt;P&gt;Hello, I'm attempting to add a new entity type to my graph schema using the named_object_type_adds method of the arcgis.graph.KnowledgeGraph class but am receiving the following error:&lt;/P&gt;&lt;PRE&gt;File &lt;SPAN class=""&gt;/opt/conda/envs/arcgis/lib/python3.11/site-packages/arcgis/graph/_service.py:732&lt;/SPAN&gt;, in &lt;SPAN class=""&gt;KnowledgeGraph.named_object_type_adds&lt;/SPAN&gt;&lt;SPAN class=""&gt;(self, entity_types, relationship_types)&lt;/SPAN&gt;
&lt;SPAN class=""&gt;    729&lt;/SPAN&gt; &lt;SPAN class=""&gt;for&lt;/SPAN&gt; relationship_type &lt;SPAN class=""&gt;in&lt;/SPAN&gt; relationship_types:
&lt;SPAN class=""&gt;    730&lt;/SPAN&gt;     r_enc&lt;SPAN&gt;.&lt;/SPAN&gt;add_relationship_type(relationship_type)
&lt;SPAN class=""&gt;--&amp;gt; 732&lt;/SPAN&gt; r_enc&lt;SPAN&gt;.&lt;/SPAN&gt;encode()
&lt;SPAN class=""&gt;    733&lt;/SPAN&gt; error &lt;SPAN&gt;=&lt;/SPAN&gt; r_enc&lt;SPAN&gt;.&lt;/SPAN&gt;get_encoding_result()&lt;SPAN&gt;.&lt;/SPAN&gt;error
&lt;SPAN class=""&gt;    734&lt;/SPAN&gt; &lt;SPAN class=""&gt;if&lt;/SPAN&gt; error&lt;SPAN&gt;.&lt;/SPAN&gt;error_code &lt;SPAN&gt;!=&lt;/SPAN&gt; &lt;SPAN&gt;0&lt;/SPAN&gt;:

&lt;SPAN class=""&gt;TypeError&lt;/SPAN&gt;: encode(): incompatible function arguments. The following argument types are supported:
    1. (self: GraphEncoder) -&amp;gt; None

Invoked with: &amp;lt;arcgis.graph._arcgisknowledge.GraphNamedObjectTypeAddsRequestEncoder object at 0x7fced37e5170&amp;gt;&lt;/PRE&gt;&lt;P&gt;For context, my Knowledge Server is version 11.3 and running on a Linux OS (alongside a base ArcGIS Enterprise setup which federates the Knowledge Server). I am calling the command from a Jupyter Notebook server running on ESRI's docker container (&lt;SPAN&gt;ghcr.io/&lt;/SPAN&gt;&lt;SPAN&gt;esri/arcgis-python-api-notebook). I'm able to authenticate fine (gis = GIS(username=xyzxy, password=xyzxy)) and can confirm I have the necessary rights to create and edit graphs (role: org_admin). I am also able to make graphs, and add entities where their type already exists (i.e., Document entities which are created when the KG is made). Despite this, I cannot edit the graph's schema.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am able to use the same entity_type definition in an ArcGIS Pro-hosted/authenticated session on a Azure-hosted graph, so I'm fairly certain it isn't the entity_type syntax. I'm also confident it isn't related to authentication as I am able to make new KGs, delete them and add entities where their type exists. My hunch is it relates to the ArcGIS Python API (2.4.0).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Has anyone else had this issue?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My next steps will be to downgrade the ArcGIS Python API, and maybe try on Enterprise 11.2.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2024 13:56:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-knowledge-questions/typeerror-encode-on-calling-named-object-type-adds/m-p/1556782#M99</guid>
      <dc:creator>nickk14</dc:creator>
      <dc:date>2024-11-08T13:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: TypeError: encode() on calling named_object_type_adds (Enterprise 11.3, ArcGIS Python API 2.4.0)</title>
      <link>https://community.esri.com/t5/arcgis-knowledge-questions/typeerror-encode-on-calling-named-object-type-adds/m-p/1557605#M100</link>
      <description>&lt;P&gt;Hello, we recently discovered and fixed this bug which prevents data model (schema) editing specifically when the python script is run in a Linux environment. It will be fixed in the next release of the Python API so the workaround would be to use an older version for now.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2024 16:33:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-knowledge-questions/typeerror-encode-on-calling-named-object-type-adds/m-p/1557605#M100</guid>
      <dc:creator>MeganBanaski1</dc:creator>
      <dc:date>2024-11-12T16:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: TypeError: encode() on calling named_object_type_adds (Enterprise 11.3, ArcGIS Python API 2.4.0)</title>
      <link>https://community.esri.com/t5/arcgis-knowledge-questions/typeerror-encode-on-calling-named-object-type-adds/m-p/1559115#M101</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/103333"&gt;@MeganBanaski1&lt;/a&gt;. I can confirm version 2.1.0 of the ArcGIS Python API lets you edit the graph schema (tested using ESRI's Docker deployment of the Python API). There are a few drawbacks of other functionality not being present (query_streaming), but I've yet to come across anything that can't be worked around.&lt;/P&gt;&lt;P&gt;Looking forward to version 2.5!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 12:49:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-knowledge-questions/typeerror-encode-on-calling-named-object-type-adds/m-p/1559115#M101</guid>
      <dc:creator>nickk14</dc:creator>
      <dc:date>2024-11-15T12:49:21Z</dc:date>
    </item>
  </channel>
</rss>

