# Serialization error passing an Ontology object into an AIP Logic Function exposed via OSDK

**URL:** <https://community.palantir.com/t/serialization-error-passing-an-ontology-object-into-an-aip-logic-function-exposed-via-osdk/836>\
**Category:** Ask the Community\
**Tags:** osdk, functions\
**Created:** [July 25, 2024, 4:54pm UTC](https://community.palantir.com/t/serialization-error-passing-an-ontology-object-into-an-aip-logic-function-exposed-via-osdk/836 "2024-07-25T16:54:46Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Natrix](https://avatars.discourse-cdn.com/v4/letter/n/b782af/32.png) [@Natrix](https://community.palantir.com/u/Natrix)\
**Post date:** [July 25, 2024, 4:54pm UTC](https://community.palantir.com/t/serialization-error-passing-an-ontology-object-into-an-aip-logic-function-exposed-via-osdk/836/1 "2024-07-25T16:54:46Z")

</div>

I have an AIP Logic function that accepts an Ontology object as input. I have an Application SDK that exposes both the Ontology object set and the AIP Logic function. When I query the Object set to select a single object and pass that object into the AIP Logic function remotely, I get the following serialization error:

```auto
Object of type Ace is not JSON serializable
  File "/home/user/data-at-acke-transformations/python/automation/ace_model_conversion/convert_ace_to_dbt.py", line 13, in convert_ace_model_to_dbt_model
    dbt_model = client.ontology.queries.cconver_ace_to_dbt_beta(ace_model=foundry_ace_model)
  File "/home/user/data-at-acme-transformations/python/automation/ace_model_conversion/execute.py", line 5, in <module>
    convertAceToDbt.convert_ace_model_to_dbt_model()
TypeError: Object of type Ace is not JSON serializable

```

---

<div class="post-metadata">

**Author:** ![ewitkon](https://avatars.discourse-cdn.com/v4/letter/e/e56c9b/32.png) [@ewitkon](https://community.palantir.com/u/ewitkon)\
**Post date:** [July 26, 2024, 1:41pm UTC](https://community.palantir.com/t/serialization-error-passing-an-ontology-object-into-an-aip-logic-function-exposed-via-osdk/836/2 "2024-07-26T13:41:19Z")

</div>

Can you please share the line of code you call the function and the parameter declaration ahead of it?

---

<div class="post-metadata">

**Author:** ![Natrix](https://avatars.discourse-cdn.com/v4/letter/n/b782af/32.png) [@Natrix](https://community.palantir.com/u/Natrix)\
**Post date:** [July 26, 2024, 3:29pm UTC](https://community.palantir.com/t/serialization-error-passing-an-ontology-object-into-an-aip-logic-function-exposed-via-osdk/836/3 "2024-07-26T15:29:52Z")

</div>

```auto
                client = Config.get_foundry_client()
                foundry_ace_model = client.ontology.objects.Ace.get(ace_model["sql_model_name"])
                dbt_model = client.ontology.queries.cconver_ace_to_dbt_beta(ace_model=foundry_ace_model)

```

---

<div class="post-metadata">

**Author:** ![jzhang](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jzhang](https://community.palantir.com/u/jzhang)\
**Post date:** [July 26, 2024, 9:11pm UTC](https://community.palantir.com/t/serialization-error-passing-an-ontology-object-into-an-aip-logic-function-exposed-via-osdk/836/4 "2024-07-26T21:11:13Z")

</div>

Hi @Natrix! I think I’ve found the bug. The fix probably won’t be in until next week. in the meantime, can you try inputing the `primary_key` of the object to your query instead of the object itself?  
e.g.  
`client.ontology.queries.cconver_ace_to_dbt_beta(ace_model=foundry_ace_model.get_primary_key())`

---

<div class="post-metadata">

**Author:** ![Natrix](https://avatars.discourse-cdn.com/v4/letter/n/b782af/32.png) [@Natrix](https://community.palantir.com/u/Natrix)\
**Post date:** [July 30, 2024, 11:41am UTC](https://community.palantir.com/t/serialization-error-passing-an-ontology-object-into-an-aip-logic-function-exposed-via-osdk/836/5 "2024-07-30T11:41:22Z")

</div>

Thanks @jzhang. I tried to use the primary key like you suggested as am now getting this internal error. I am unable to see the actual error. (See Below)

```auto
dbt_model = client.ontology.queries.cconver_ace_to_dbt_beta(ace_model=foundry_ace_model.get_primary_key())

```

```auto
{
    "errorCode": "INTERNAL",
    "errorInstanceId": "331b39e5-d931-4837-979e-8ef18a3a293d",
    "errorName": "Default:Internal",
    "parameters": {}
}

```

---

<div class="post-metadata">

**Author:** ![jzhang](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jzhang](https://community.palantir.com/u/jzhang)\
**Post date:** [July 30, 2024, 10:18pm UTC](https://community.palantir.com/t/serialization-error-passing-an-ontology-object-into-an-aip-logic-function-exposed-via-osdk/836/6 "2024-07-30T22:18:57Z")

</div>

Hmm a few quesions:

- Is the function able to execute in AIP Logic for some example object? Like, have you been able to execute the function before using the UI?
- Also, how did you construct your client? (`get_foundry_client()` ) Was this based off the docs in developer console? Are you using ConfidentialClientAuth?

---

<div class="post-metadata">

**Author:** ![system](https://yyz1.discourse-cdn.com/palantir/user_avatar/community.palantir.com/system/32/3_2.png) [@system](https://community.palantir.com/u/system)\
**Post date:** [January 8, 2025, 4:59am UTC](https://community.palantir.com/t/serialization-error-passing-an-ontology-object-into-an-aip-logic-function-exposed-via-osdk/836/7 "2025-01-08T04:59:20Z")

</div>

Automatically bumped on January 8, 2025, 4:59am UTC



---

<div class="post-metadata">

**Author:** ![system](https://yyz1.discourse-cdn.com/palantir/user_avatar/community.palantir.com/system/32/3_2.png) [@system](https://community.palantir.com/u/system)\
**Post date:** [June 25, 2025, 9:08am UTC](https://community.palantir.com/t/serialization-error-passing-an-ontology-object-into-an-aip-logic-function-exposed-via-osdk/836/8 "2025-06-25T09:08:43Z")

</div>

Automatically bumped on June 25, 2025, 9:08am UTC



---

<div class="post-metadata">

**Author:** ![system](https://yyz1.discourse-cdn.com/palantir/user_avatar/community.palantir.com/system/32/3_2.png) [@system](https://community.palantir.com/u/system)\
**Post date:** [August 23, 2026, 12:24pm UTC](https://community.palantir.com/t/serialization-error-passing-an-ontology-object-into-an-aip-logic-function-exposed-via-osdk/836/9 "2026-08-23T12:24:10Z")

</div>

Automatically bumped on August 23, 2026, 12:24pm UTC


