Skip to main content
Seasoned ⭐️
Aug 9, 2026 7:26 PM UTC
Gathering Interest

Data types when listing instances

Related products:Data ModelingPython SDK

When listing instances of a view and using the to_pandas method, is there a simple way to use the data types defined on the container properties and use these to cast to similar python data types? Or could this be an option of the python SDK?

In the classical CDF data types, this is implemented so that for example a date field and timestamp fields have the correct python data type. The data modelling instances will be either floats or string. It would be very convenient if the underlying container data type can be used so that you do not have to manually cast values in the pandas dataframe.

4 replies

Practitioner ⭐️⭐️⭐️
Aug 10, 2026 10:45 AM UTC

Take a look at TypedNode (or -Edge) we support in the SDK. It requires some “manual setup” (one time) then gives you correct types + attribute based access. Check out the example “class Person(TypedNode)”, e.g. here:

https://cognite-sdk-python.readthedocs-hosted.com/en/latest/generated/cognite.client.AsyncCogniteClient.data_modeling.instances.retrieve_nodes.html#cognite.client.AsyncCogniteClient.data_modeling.instances.retrieve_nodes

Besides that - I agree with your point about using the available type info. Will have a chat with the team 👍

Seasoned ⭐️
Aug 12, 2026 7:39 AM UTC

Great, thanks :) 

Mithila Jayalath
Expert ⭐️⭐️⭐️⭐️
Expert ⭐️⭐️⭐️⭐️
Aug 10, 2026 11:31 AM UTC

​@Johan Dahl I’ll convert this question into a product idea.

Seasoned ⭐️
Aug 12, 2026 7:39 AM UTC

Perfect, thank you :) FYI ​@Gunnar Andreas