Join the discussions about products powered by Cognite Data Fusion. Click the + CREATE TOPIC button in the menu bar to start the conversation.
Recently active
I have some views with simple array properties (arrays of primitives) and others with arrays of relationships to views (edges).Location viewI can filter the simple arrays with the “containsAll” or “containsAny” methods.But there seems to not be a filter avaiable for the edges in the Graphql API. How can I filter by these properties via the GraphQL API?
Hi I have a final computed dataframe that looks like this. sample set alone listed here (15 rows) There are 570 records. I need to create timeseries for sumprod and derivedYields columns as per the value in Yieldcode. I have written the code and it is running and timeseries is getting created. But it is running slow. How to make it get done faster?Any best method? Please advise sumprod Yieldcode Rank Group derivedYields MBBLD Vol LP-Class 1 532 0.009636 VBALFG1 1 VBAL 0.009636 3.524946 FG1 2 533 0 VBALLP1 2 VBAL 0 0 LP1 3 534 0.210269 VBALFN1 3 VBAL 0.218807 80.0382 FN1 4 535 0.037774 VBALLW1 4 VBAL 0 0 LW1 5 536 0.048263 VBALSK1 5 VBAL 0.094867 34.70158 SK1 6 537 0.017368 VBALHK1 6 VBAL 0 0 HK1 7 538 0.128149 VBALSR1 7 VBAL 0.142624 52.17094 SR1 8 539 0.014722 VBALDS1 8 VBAL 0 0 DS1 9 540 0.034342 VBALAG1 9 VBAL 0.0345
I have been working on this for some time now. It was all running fine till now but suddenly it is failing now, and it is giving an error for this function. Is there something that has been changed in the platform/library?DB name and table name are all accurate and was running fine till today. lp_df_input = client.raw.rows.retrieve_dataframe(db_name="Eashwar_MOTDB-db",table_name="lp_input",limit=None,columns=None)Error: ---------------------------------------------------------------------------MissingSchema Traceback (most recent call last)Cell In[30], line 1----> 1 lp_df_input = client.raw.rows.retrieve_dataframe(db_name="Eashwar_MOTDB-db",table_name="lp_input",limit=None,columns=None)File /lib/python3.11/site-packages/cognite/client/_api/raw.py:613, in RawRowsAPI.retrieve_dataframe(self, db_name, table_name, min_last_updated_time, max_last_updated_time, columns, limit) 589 """`Retrieve rows in a table as a pandas dataframe. <https://developer.cog
Hi,I need to connect to CDF with Power BI and when trying to load the table, I get this error:It only loads a limited rows of data (probably those rows have no errors) and I cannot change the format of the fields in PBI.I already whent thru the documentation , but the solution provided there does not work in this case (there is no option to change the data format).For other datasets (other data sources), where Power BI encounters errors, the data is still loaded (with errors), but in this case, the data is not loaded and the import is stopped by the error. This is also keeping for saving the report or using the data source.The behavior needed is that PowerBI is loading the entire dataset with errors and to change the field format before importing the data.Thank you!
I’m facing the above issue while running the demo cognite custom extractor
I am looking forward to a solution for reading a csv files that has 100 columns and 200 rows. It is stored in CDF as ‘Files’. How do I read the file and then use pandas to convert the file as a dataframe?diet_f= (client.files.list(name='diet_daily.csv'))[0]diet_daily_transformed = pd.read_csv(diet_f.name)diet_daily_transformedThis isnt working and throwing an error. Please advise the best means to perform this task.
I have a helper function that returns a CogniteClient via interactive OAuth authentication. This worked literally yesterday, but gives me an error today.This is my function definition import osfrom cognite.client import CogniteClient, ClientConfigfrom cognite.client.credentials import OAuthInteractivefrom typing import Uniondef authenticate_to_cognite_oauth( project: str="akerbp", client_name: str="Employee", client_id: Union[str, type(None)]=None, tenant_id: Union[str, type(None)]=None, base_url: str="https://api.cognitedata.com" ) -> CogniteClient: """Authenticate to Cognite via OAuth interactive login. Return cognite.client.CogniteClient.""" if client_id is None: client_id = os.getenv("CDF_CLIENT_ID") if tenant_id is None: tenant_id = os.getenv("CDF_TENANT_ID") authority_url = f"https://login.microsoftonline.com/{tenant_id}" scopes = [f"{base_url}/.default"] creds = OAuthInteractive( authority_url=authority_u
I want to create a cognite function that will do lot of computations and finally attach the derived output to a timeseries. Is there some production-ready sample code snippet that can be shared to see how to attach a derived value from cognite function to a timseries?
Hi Team, We are working on a POC , where we need to create unit test cases where we are facing different issues .For reference we are using code from Cognite HubBelow attaching our code and output expectations .Please help with the approach to resolve this issue ts_retrieved = [ TimeSeries( id= 3973245479016710, external_id= "Brazil:3W:Well-Bore-19B_target_throughput", name= "Brazil:3W:Well-Bore-19B_target_throughput", is_string= False, metadata= {}, unit= "Barrel", asset_id= 3332326574821917, is_step= False, description= "target volume for a oil well bore", security_categories= [], data_set_id= 8739280581150161, created_time= "2023-05-02 09:37:04.944000", last_updated_time= "2023-05-02 09:37:04.944000")]@pytest.fixturedef cognite_client_mock(): with monkeypatch_cognite_client() as client: client.assets.retrieve().time_series().get().return_value = ts_retrieved return client Method code ts_data = c.assets.retrieve(
Please share Cognite deployment architecture diagram. How storage is maintained on public cloud in various regions?
Getting OSError: [Errno 22] Invalid argument while I am running a query while other queries are running.And also this query is running in SQL server only giving error of invalid argument while ingesting timeseries data in extractor.
scenarios we are working on, To show PI&D diagram with annotations, which help to select the asset and create a threat for that asset. Or draw a rectangle over the PI&D diagram to select multiple assets. For the above two scenarios we are referring APIs in,https://docs.cognite.com/api/v1/#tag/Engineering-diagrams Quickstart — cognite-sdk 5.3.1 documentation (readthedocs-hosted.com) We are successful in getting the PI&D as image by following the below steps,1. List Fileshttps://api.cognitedata.com/api/v1/projects/{project}/files2. Convert a diagram to image formathttps://api.cognitedata.com/api/v1/projects/{project}/context/diagram/convert/3. Get the results for converting an engineering diagram to an imagehttps://api.cognitedata.com/api/v1/projects/{project}/context/diagram/convert/{jobId} Could you please guide with APIs / JavaScript SDK methods we need to work on for the above mentioned two scenarios.
I have some code working great via a Notebook, but I want to move it to a server where I can run it as daemon. The authentication is failing when I run it on the server.I suspect the problem is with the Scopes - User impersonation might work in the browser where I’m already logged in to the right project. What scope should I use instead when I’m calling directly from Python?Also tried myscope = '[f"https://westeurope-1.cognitedata.com/.default"]'as suggested in the documentationoauthlib.oauth2.rfc6749.errors.AccessDeniedError: (access_denied) Unauthorizedfrom cognite.client import CogniteClient, ClientConfigfrom cognite.client.credentials import OAuthClientCredentialsfrom cognite.client.data_classes import TimeSerieshost = "https://westeurope-1.cognitedata.com"myproject = "rok-buandcollaborators-53"clientid = "realStuffWasHere"secret = "secretsecretsecretsecretsecretsecret"#myscope = "https://westeurope-1.cognitedata.com/.default"myscope='["IDENTITY", "user_impersonation"]'token="https
I created a set of timeseries via the API. The Python examples do not show how to include an externalId nor do they say one is really needed. Looks like they need one, otherwise they don’t work in Charts. That’s all fine. My problem now is to add the externalId to existing timeseries.I think the right way to do this is with a transform, but I can’t get it right. I can get it to preview correctly, but it fails when I run it.My transform is:Select name as name, concat(name,"123") as externalIdfrom `_cdf`.`timeseries` where dataSetId = 8883655420989208;The error is Request with id 2463250f-1635-9a05-aa9a-709366e80349 to https://westeurope-1.cognitedata.com/api/v1/projects/rok-buandcollaborators-53/timeseries/update failed with status 400: Time series not found. Missing externalIds: [Tank-401-01-TT123].Looks like it’s trying to query for the timeseries with that externaId when I’m trying to set the externalId. How do I get it to set the value?
How to fetch all the timeseries linked to an asset? I have a root asset that has 16 child assets. Each of those child has 18 timeseries objects. How do I write a code so that I can loop through this setup and read each of those timeseries objects and read the datapoint for a particular day and gather them. root = client.assets.list(name='liquid_asset')children=client.assets.list(parent_ids=[root[0].id])for i in children: print(i.time_series)Result is this: <bound method Asset.time_series of <cognite.client.data_classes.assets.Asset object at 0x3468500>>I could not iterate through the i.timeseries and read the datapoint from a very specific timeseries object named as 'PVOL'. Please help.
Hello, I am trying to create a row instance in my data model that references multiple other types, via the REST API.I can do that fine with single relatioships, but when I get the ErrorCannot ingest into a connection property: supportingCast in view 'Film:Actor/xxxxxxxxxxx'.when I try an array of types like this:{ "externalId": "Oppenheimer", "space": "imdb", "lead": { "externalId": "CillianMurphy", "space": "imdb" }, "supportingCast": [ { "externalId": "EmilyBlunt", "space": "imdb" }, { "externalId": "RobertDowneyJr", "space": "imdb" } ]}The supportingCast property is the problem is this case.
Hi,We can resize the column width in the instance view in FDM, but if we scroll down to load more instances, the column width goes back the the default one. Could you help have a check if that is a bug in the UI?After resize to the externald column:After scroll down:Regards,Xiaofeng
Hi,Currently we have a limit on the POST models/instances where we only allow to post 1000 instances at a time.This operation is currently limited to 1000 nodes and/or edges at a time.Normally between the instances there are dependencies so it is not very easy to split the request to multiple calls. Do you think it is possible to lift that limit to a big number, f.ex. 10000? Regards,Xiaofeng
I uploaded a CSV into a raw table in cognite data fusion. Now I have seen the raw table and see 200 numeric columns and 2 text columns are present. When i come to SDK and retrieve the rows from the same table as dataframe, it is showing 199 columns as numeric and 3 text columns. there was one specific column '0NA' which was originally a numeric column now shows the datatype as 'object' instead of 'float64'. I checked and there are no null values and no other NaN characters and it's just decimal values all across. When I fetch all numeric columns directly from CSV, I see the column as float-64 but after importing that CSV into RAW table, it is doing something else. I tried to see the unique values in the column and found these two as string,I suppose. In CSV , they were stored as number but when uploading to RAW table, it does convert into something like this. Please help if RAW table cannot accommodate values with more than 10E142 values such as these?. How to handle this scenario.'241
Hi,we are looking for a 2D file/diagram viewer compatible with https://developer.cognite.com/api/#tag/Annotations to be used inside our own application, that is outside of the Cognite application suite.Question: What are the current plans regarding opening “Unified File Viewer” in a similar fashion as https://github.com/cognitedata/reveal?Bonus question: Is it / would it be possible to annotate other things than asset tags?
Hello,We are trying to fetch the edges of an view in a graphql.But graphql is returning only 50 edges at max. We see the cursor option in graphql, but it seems that it has been not implemented and is giving null even if there exists more data.So question is - When the cursor functionality for edges will be avaialble in graphql or some know issue as of now ? If this is a limitation how do we get edges data joined with the view data where the edge is present using the rest endpoints. Any best combination suggested as there will be multiple stages to resolve the cursor and the edges data, as we understand it.Request your quick ideas on this how it could be achieved.
I was trying to check SDK creating an asset hierarchy along with children (16). I created it in a improper structure and wanted to delete all of them and redo it from scratch. When i try deleting it, i am getting an error. client.assets.delete(i.id)CogniteNotFoundError: Not found: [{'id': 1035393670500031}]The API Failed to process some items.But when i see the list for the parent id, I am to list all of the ids completelyassets_subtree = client.assets.list(asset_subtree_ids=[3043982824375333])for i in assets_subtree: if i.name != 'LPM_YT_MODEL': print(i.id,i.name,i.description)
I have a daily feed data of the form coming as a file in sharepointDate AX1 AB1 AW1 AN1 AR1 AB1 BW1 BG1 BT1 01-01-2023 0.23 1.23 2.54 0.98 0.655 1.09 0.87 0.34 0.19 01-02-2023 0.34 0.56 0.44 0.89 0.576 0.81 1.29 1.11 0.67 …... ….. ….. …... …... …... …... …... …... ….. I need to pull this data and transform it into an applicable resource-type (Sequences in CDF). I don’t want to store as time series since I need this in tabular form to operate further and do matrix and dot product etc. Is there a way to write a transformation to push it as ‘sequences’ so that I can use it as a matrix to perform further calculations?Please share some example SQL transformation snippets to achieve this.
Hello data modeling team, I tried the "first" and "after" filter on Query Explorer which enables us to retrieve the query result page by page, it works well.while we have an existing API which enables the consumer to specify an "offset" and a "limit" parameter. by the offset, the consumer could retrieve records at any specific page without the need to always go though from the beginning and then retrieve page by page, it's like the skip and limit syntax in mongodb, for example, db.myCollection.find().skip(200000).limit(50).we want to keep the API behavior so no modification needed for existing consumer, while we do not want to simulate the offset behavior by retrieving page by page within our own API since it will be very low efficient when there is a big dataset, so is it possible to provide the offset supporting in Cognite ? or any suggestions/methods we could try to implement this ? Thanks!
Hi, I am looking for documentation regarding what kind of DM structure change is considered as safe change, breaking change or unsupported change in the data modelling but couldn’t find it. And is it possible to provide best practices for DM versioning management? Kind advice.Thank you, Kind regards, Carrie