Join the discussions focusing on developing on top of Cognite Data Fusion. Click the + CREATE TOPIC button in the menu bar to start the conversation.
Recently active
We are trying to implement automatic monitoring over our transformations in CDF. We are doing this by running a transformation and a monitoring function in the same workflow, where the monitoring function is dependent on the transformation being finished.Then we retrieve the sum of updated and created events like this: def _created_and_updated_sum(self, transformation_external_id: str) -> int: """ Get the sum of the number of created and updated events in the last transformation job. If there are no finished jobs, return 0 instead. """ transformation = self.cdf_client.transformations.retrieve( external_id = transformation_external_id, ) if transformation is None: raise ValueError(f"Transformation {transformation_external_id} not found") if transformation.last_finished_job is None: DUMMY = 0 self.logger.info(f"Transformation {transformation_external_id} has no finished jobs.
Hello people,I’m testing CDM and I want to extend a current model type, I may do it wrong, but my idea is. I’m creating a new type called MyModel, that will be pretty much and CogniteActivity + new fields.But I don’t know what I’m doing wrong.type MyModel @import ( dataModel: { externalId: "CogniteActivity", space: "cdf_cdm", version: "v1" } ){ FieldA: String, FieldB: String}I got some guidance from this link https://docs.cognite.com/cdf/dm/dm_guides/dm_extending_core_data_modelWhen I try to save, I got this error{ "title": "Error: could not update data model", "message": "An error has occured. Data model was not published.", "extra": "[Line: 40] Data model 'DataModelRef(space=cdf_cdm, externalId=CogniteActivity, version=v1)' cannot be found" }Thanks in advance
On behalf of CelaneseHi.I would like to report a potential issue with cursor-based pagination when sorting in descending order and request clarification on the undocumented forceCursorsDespitePerformanceHazard flag.We are executing a query against the view OEEEvent, which is defined with a cursorable BTREE index on the startDateTime property, as shown in the simplified schema below: type OEEEvent@container( indexes: [ { fields: ["startDateTime"] identifier: "idx_oeev_startDateTime" indexType: BTREE cursorable: true } ]) { startDateTime: Timestamp endDateTime: Timestamp totalDuration: Float} We are querying with the following time range filter: "startDateTime": { "gte": "2024-12-31T00:00:00.000-03:00", "lt": "2025-05-01T00:00:00.000-03:00"} The result set includes 840 records.When applying a page size of 500 and using the following ascending sort configuration: { "property": [ "INO-COR-ALL-DML", "OEEEvent/472bdbcb9cd6f1", "startDateTime" ],
Hi,Will there be any major changes to the API and Python SDK when moving from an asset centric data model to a flexible data model? Do we have to expect to refactor our backend using the current python sdk once the flexible data model is operationalized?Best regards,Vetle.
I’m trying to update the is_string value of Time Series from false to true using CDF python class ognite.client.data_classes.time_series.TimeSeriesUpdate. But I’m unable to update it. The value in CDF remains false even though I updated it. Is this an expected behavior of Time Series Update?
Hi,I have set up a monitoring job to generate alerts for specific time-series. Although, it is not clear to me where these alerts are being stored as I can’t find them anywhere in Data Explorer. The documentation (https://docs.cognite.com/cdf/charts/) also doesn’t provide details about it.Can someone share more details about how the alerts are stored and if it’s possible to access them outside Charts?
Hello,I notice from the Events API documentation that the start_time can be specified by a TimestampRange object. However, the documentation does not explain what this object is, whether it is a class external to the Cognite SDK, or give any examples on how to use it.Can someone give more information?-Anders
Since yesterday, I've noticed that deploying functions via the Cognite SDK is failing. Our strategy involves uploading a zip file of the function and then creating the function. While the file uploads successfully, the function creation process returns a "Gateway Timeout" error. I've tried deploying both locally and through the Azure Pipeline, but the error persists. Initially, I thought it might be a temporary instability, but the issue continues this morning. Cognite API error
Hello, we are facing an SSL issue while trying to connect to cognite even if we’re disabling SSL verification.Could you please help ?from cognite.client import ClientConfig, CogniteClientfrom cognite.client.credentials import OAuthClientCredentialsfrom cognite.client.config import global_configglobal_config.disable_ssl = Truecreds = OAuthClientCredentials( **{ "client_id": "", "client_secret": "", "token_url": "", "scopes": ["https://westeurope-1.cognitedata.com/.default"], } )def get_cognite_client(project: str) -> CogniteClient: return CogniteClient( ClientConfig( client_name="Python-jupyter", project=project, credentials=creds, base_url="https://westeurope-1.cognitedata.com", ) )client = get_cognite_client("totalenergies-sandbox")res = client.units.list().to_pandas()------------------------------------------------------------------------------------
Hello, We have been trying to download this package (spgci) using Jupyter in CDF but are getting the following error: Based on this documentation, it seems like its not possible to do so. Could you please advise if there is a solution for this issue?
Hi,I have a view called "Entity" in an existing model with mandatory properties "name", "description" and "isVirtual".Now, I have a new version of "Entity" in which I have decided to implement CogniteDescribable from CDM for name and description, where these fields are not mandatory.When I try to ingest data into the new version of this view, it gives me a non-writable error since the mandatory properties that I had created for the older version is not getting populated.Is there any way to overcome this?Can I map the mandatory container to the container used in CogniteDescribable, so that when I ingest data in the new version, it automatically ingests the mandatory container as well?If yes, can you please share a YAML example of the same to be deployed through toolkit?Please note that both the mandatory and non-mandatory containers have the same name "name".
Hello experts,We want to achieve the following workflow:Once a new instance is created/added in our datamodel container Another workflow must be triggered immediately We do not want to create a scheduled based polling to invoke our workflow since our workflow is time sensitive and high importanceCould you please let us know if CDF supports this functionality? Or suggest a way to achieve it.I have explored the CDF in my limited knowledge, I found that subscription is available on Data Model, but it is not enabled in our environment.Could you please help me in this.Thanks,Pranjul Singh
When retrieving time-series data registered in CDF using the SDK, I use the following code.client.time_series.search(name="some name")In this case, if I want to take 100 time series, I would need to run the above code 100 times, but is there any SDK that allows me to retrieve this in a list format or something similar?
I'm using python sdk and wanted to query instances based on a condition using “data_modeling.instances.query” method. i have a view “TimeseriesProperty” and it has a direct relation/reference to "TimeseriesPropertyType" view. Is it possible to have a distinct filter on the result, because multiple “TimeseriesProperty” instances can have the same "TimeseriesPropertyType" instances , we don't want duplicated "TimeseriesPropertyType" instances coming in response for below query: view_id= ViewId(space="slb-pdm-dm-governed", external_id="TimeseriesProperty",version="2_0")v_id_2_PROP = ViewId(space="slb-pdm-dm-governed", external_id="TimeseriesPropertyType",version="2_0")query= Query( with_= { "TimeseriesProperty":NodeResultSetExpression( limit=10, filter= HasData(views=[view_id])), "TimeseriesPropertyType":NodeResultSetExpression( limit=10000, direction="outwards",
Use CaseI am building a dashboard in Power BI that will visualize Events from CDF (about one million events per year). So to make the solution scale I want to use incremental refresh of the semantic model so I only refresh the model with the newest Events since the last refresh.I have followed your tutorial on Incremental refresh (which seems copy/paste of Microsoft’s tutorial), but I still have questions:What happens if the StartTime attribute of an Event is a date/time/zone when loaded into the model? The attribute needs to be a date/time type, which means I need to convert the type first. How will the incremental refresh work if the model needs to load the data in order to convert the type, and then apply the RangeStart/RangeEnd filters? Can I use Incremental refersh with the new REST API Connector? When I load events with the new connector I get the start times as number of milliseconds since epoch. So the type conversion from above also applies here. Thanks for your help!Anders
I have a data model and would like to retrieve or list nodes from a specific view. Specifically, I want to list nodes that have been created or updated, for instance in the last 30 days, using Pygen.I understand that Pygen provides filtering capabilities to filter based on view properties or columns. However, I don't see a way to filter by the updated date, which is a column automatically created under the data_record column when inserting new nodes with Pygen. It seems Pygen doesn’t expose this field as a filter parameter.Is there a way to apply a filter on data_record.updated_date using Pygen?
Hi team, I want to import some functions from util folder which is same directory of the folder in which handler.py. As files in util folder is being used by other cognite functions too, I can’t keep the files of util folder in function_folder but at the time of importing functions from files of util folder and after deploying cognite function it gives import error as so basically structure is Repofunction_folder- file1 and handler.pyutil_folder - file2 and file 3 And I want to use methods from file 2 into handler.py and I have added __init__.py in util folder 2025-04-04T12:17+05:30 : Traceback (most recent call last): 2025-04-04T12:17+05:30 : File "/home/site/wwwroot/function/_cognite_function_entry_point.py", line 297, in import_user_module 2025-04-04T12:17+05:30 : handler = importlib.import_module(handler_module_path) 2025-04-04T12:17+05:30 : File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module 2025-04-04T12:17+05:30 : return _bootstrap._gcd_import(name
Hello As our industrial data evolves; we're facing challenges with schema versioning specifically when modifying / extending the properties of existing asset or time series types in Cognite Data Fusion (CDF). 🙂For instance; adding new fields or changing data types (e.g., integer to float) in metadata often breaks downstream pipelines or applications that expect the original structure. CDF doesn’t enforce a strict schema, but how do others handle backward compatibility in real-world use?😐We’ve experimented with versioned types and custom labels to signal changes, but this quickly becomes hard to manage at scale. Some of our consumers rely on fixed field names, and introducing Salesforce Developer Course breaking changes results in unexpected behaviors in the SDKs or fusion apps.😐Is there a recommended practice for managing schema evolution that preserves data integrity while enabling flexibility for growth?🤔Looking to hear how other developers are addressing this challenge—do you v
Hello, As per the docuementaiton Pygen exposes a `graphql_query` method. However, I’m not able to find it. Could you please help? version used: cognite-pygen==1.2.1Thanks
Hello, We are using cdf toolkit to deploy our container, views and data models.We recently added many new views, these views are dependent. i.e: they reference each other in the properties through a source block or via implements block. Here an examples of these view dependencies:- externalId: View1 implements: [] name: View1 properties: test: container: externalId: Container1 space: some_space type: container containerPropertyIdentifier: Test name: test source: externalId: View2 space: some_space type: view version: v1 space: some_space version: v1- externalId: View2 implements: [] name: View2 properties: wow: container: externalId: Container2 space: some_space type: container containerPropertyIdentifier: Test name: wow space: some_space version: v1or - externalId: Country implements: - externalId: CountryAttributes space: '{{sp_dm_dap_knowledge_graph}}_wv'
I am trying to use the CogniteSdk in c# to build my FDM model node and egde. I able to insert the node accordingly but having issue when trying to define the edge. As you can see below , to create an edge, it require the "Type" to be define. There is no error but when i check my UserDashboard model, it cannot link to my DashboardItem. Anyone know how we can insert Edge using C# SDK? FDM:type UserDashboard @view(version: "c3020ef716088a") { userId: String! createdDateTime: Timestamp lastUpdateDatetime: Timestamp dashboard: [DashboardItem]}type DashboardItem @view(version: "62c414860c7734") { userId: String! index: Int! id: Int!} UserDashboard DashboardItem
Hello Team,I am trying to check like how many edges(entities in my case) are null in the view(event) is there any specific way to do so? I am trying right now sdk query api like below, but not working. Please give your insights. { "with": { "Event": { "nodes": { "filter": { "hasData": [ { "type": "view", "space": "slb-pdm-dm-governed", "externalId": "Event", "version": "1_7" } ] }, "chain_to": "destination", "direction": "outwards" }, "limit": 10000 }, "Event_2_entities.Entity": { "edges": { "from": "Event", "direction": "outwards", "filter": { "and": [ { "equ
I'm using python sdk and wanted to query instances based on a condition using “data_modeling.instances.query” methos . I have a view called TimeseriesPropertyType which has a field (properties: [Property]) which is a reverse direct relation throughProperty: "propertyType".i just need to check if there are any “properties” field values associated with each instance of the TimeseriesPropertyType view. for that I'm fetching data in property view associated with those particular TimeseriesPropertyType view and doing the check manually in code.. is there any direct filter i can use that's available? i dont see any filters available on properties field in query explorer for the samebelow is the query im using #view_id_ts_prop_type - TimeseriesPropertyType view#view_id_property - Property viewquery= Query(with_= { "TimeseriesPropertyType":NodeResultSetExpression( limit=10000, filter= HasData(views=[view_id_ts_prop_type])), "Pr
Hello Team,We have three views:→ ScalarProperty{#other fieldsentity: Entity}→ Entity{#other fieldsentitytype: EntityType}→ EntityType{externalId}Given this, from ScalarProperty view, can we use groupby on entity.entityType.externalId when querying instances and counting them using the query API, or is there another way to achieve this?
The current naming convention in the OPCUA server node structure naming is not intuitive for user to be able to find the tag in Cognite.From the example below, we will have 3 timeseries tags with Message and also Data.It is not intuitive for user to look into the path or externalid to find which it is belongs to.How do we configure the OPCUA extractor to construct the timeseries name based on certain criteria or to based on the complete path of the node to be the timeseries name (e.g. Root\Temperature1\Message as the name)?E.g. OPCUA Node structureRoot|_ Temperature1 |_ Message |_ Data|_ Temperature2 |_ Message |_ Data|_ Pressure1 |_ Message |_ Data