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
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
Hi All,I am working with hosted extractors for kafka and it works pretty well for me with transformations when we have plain json data in kafka topics.Now I am trying to check if we can work with zlib gzip compressed data coming in topic, I have json string and messagepayload attribute of json string will be holding compressed data instead of whole message as compressed one, is it possible to write transformation for such data. e.g., in kafka topics{ "Header": { "MessageId": 133367162, "MessageType": "DATA_REPORT", "Timestamp": 1741122422, "PayloadCompression": "Z_LIB_COMPRESSION" }, "MessagePayload": "eJyqVnJJLctMTi1WsoquVvJLzE1VslIyVNJRckksSQxJTIeIhySmQ6WCA3wVfFMTi0uLUlNgqioLQDIu/qFOPq7xYY4+oa5KOkphiTmlMLNCMnNTi0sScwuUrAzNTQwNjYxMjAwtzA11lAJLE3MySyqVrAxqY2tjawEBAAD//x5aKt0="}
Hi Experts, Need your help on Cognite Python sdk.My goalGet all linked timeseries of an AssetI am using Asset class object https://cognite-sdk-python.readthedocs-hosted.com/en/latest/assets.html#cognite.client.data_classes.assets.Asset time_series function ProblemIt is only giving me the ‘Directly linked timeseries’ , not all the ‘Linked timeseries. Means in this case I only getting 13 timeseries objects , compared to 64 linked timeseries of the Asset. Appreciate your help on adopting the correct approach Thanks and RegardsSree
type FTAC_ActivityLog { Site: String AddDate: Date ActionComments: String VersionNumber: Int64 UserComments: String Label: String AssetId: String ActivityDate: Date Action: Int64 ActivityLogId: String SortOrderId: Int64 User: String VersionId: String AssetPathId: String}I have a mode as aboveI want to do the aggregation function for the user per site statistic. how do I prepare my aggregation query, I am new bee for this, by looking for the https://docs.cognite.com/cdf/dm/dm_graphql/dm_graphql_querying aggregation section, quite confuse.
Hi,I understand that we can define properties on edges, but it isn’t clear from the documentation how these properties are populated. I am trying to implement the following modelAnd defined the data model using DML as follows How can I add a UserActivity edge with properties start_time and stop_time, that I can read while listing all the activities that a User has performed?Thank you
After updating the event(insight) it is getting updated in the cdf portal.Passing filter to “cdf_beta_api = "https://api.cognitedata.com/api/v1/projects/{CDF-PROJECT-NAME{/events/list"” when we try to list event based on filter all of the sudden, we are getting the older data in response.When it is called again we get the updated data in response python code snippet In line 34 we are getting updated role but in line 49 we are getting older role,when it is called again we get updated response
first of all i created a new environment with below codes.python -m venv envenv\scripts\activatepip install poetry poetry config virtualenvs.in-project truepip install pandas numpypip install cognite-sdkpip install "cognite-sdk[pandas, geo]"pip install cognite-extractor-manageronce all above code completed. I started running cogex init.I am getting below error.cogex initEnter extractor name: csv extractorEnter description: descEnter author: --I provided the cognite login mail id in name <mail id>Which template should be loaded? simple: loads a generic template suitable for most source systems, using a simple function as the main entrypoint for the extractor. Most suitable for small and simple extractors. class: loads a generic template suitable for most source systems, using a run method on a class as the main entrypoint for the extractor. Most suitable for slightly bigger and more complicated extractors. rest: loads a template for extrac
I am using CogniteSdk c# to query data model from CDF. When I tried to execute it, it did not return row items. Instead it just returned below result:What is the correct way to use the DataModel in C# CogniteSdk to return rows of data as per below?
Hi Everyone,I need to create query like it is creating on cognite UI’s like { "listEntity": { "with": { "0": { "limit": 50, "nodes": { "filter": { "and": [ { "matchAll": {} }, { "hasData": [ { "type": "view", "space": "slb-pdm-dm-governed", "externalId": "Entity", "version": "1_7" } ] }, { "or": [ { "and": [ { "nested": { "scope": [ "slb-pdm-dm-governed", "Entity/1_7", "parent" ],
I am trying to update column value in view using upsert method, but it's not working and giving 400 error code. adding screenshot of upsert api, as its not matching with the input structure provided in document.
I’m trying to use Update extraction pipelines method to update my extraction pipelines created. Here are some issues i face:1. I’m unable to update contacts for an extraction pipeline, it throws the below error:code - contact_info = [ExtractionPipelineContact(name="sangs", email="sm6@slb.com", role = "MAINTAINER", send_notification=True)]to_update = ExtractionPipelineUpdate(external_id="<PIPELINE-EXT-ID-2>")to_update.contacts.set(contact_info)client.extraction_pipelines.update(to_update)error - “CogniteAPIError: Unexpected field - items[0].update.contacts.set[0].send_notification - did you mean sendNotification? | code: 400 | X-Request-ID: 918d1113-6a5e-9d38-b850-61e3dc54c220 The API Failed to process some items. Successful (2xx): [] Unknown (5xx): [] Failed (4xx): [<PIPELINE-EXT-ID-2>, ...]”2. I’m unable to set the specified fields to None using sdk : description, source, schedule,documentation, name and dataset-id. Im able to set only metadata and raw-tables to None. Wond
Across multiple javascript projects, we use the @cognite/sdk. We observe some strange behaviour when it comes to authentication and see the Chrome network panel full of HTTP 401 calls. When debugging the issue, we see that the getToken method supplied to the CogniteClient class only gets called some times. And when it does, the code on our part successfully retrieves a valid token. This leads to some unwanted behaviour and the user sometimes needs to refresh the browser in order to correct the browser state.I suspect the fact that we make a new instance of CogniteClient everytime we use it could be the culprit. I read from the source code baseCogniteClient.ts that the getToken function is not called each time in order to “To prevent calling `getToken` method multiple times in parallel”. Not that I am really able to follow this behaviour over multiple instances of the client.Any pointers as to what might cause this problem?const getToken = async () => { // this code only hits some t
I need some help with the SDK (Python). I'm trying to list active sessions in Cognite using the following resource: client.iam.sessions.list(status="ACTIVE" However, I notice that even my client_id doesn't return in the listing (I'm logged in via browser with my user). Am I misunderstanding this feature?
Hello,What are the best practices around setting the max-workers for a sdk. If I do not set the Global Config all the default values for workers and retries would be picked correct ? Can you give any reference on how we can set GlobalConfig, I mean I did not see any way to pass the GlobalConfig to ClientConfig ?
Hi Team, I need help to write the unit test using pytest,below is the code: row_list = cognite.raw.rows.list(file.destination.database, file.Extractor_Last_Run_Table, limit=-1, columns=["key", "LastUpdatedDatetime"]).to_pandas() if not row_list.empty: val = list(row_list[row_list.index.isin([file.Extractor_key])]['LastUpdatedDatetime'])Could you please help to write the unit test for above code?Thanks