Impact 2024: The Industrial Data and AI Conference for and by Users | Nominate Speakers Now for a Ch...
Thank you @Cerys James for your answer !
Thank you @Ben Brandt for that clarification !
Hello @ibrahim.alsyed ,Writing back to SAP is a use case that we solved a few times. I would say that as long as we have a SAP endpoint we can send requests to, we should be able to update work order status for example. But I think a further discussion would be needed to understand your use case and the technical details, to assess what could be done or not.
I updated the article, including more security guidance, as recommended by @terjelo. The following article is a good start with respect to best practices with Docker: https://snyk.io/blog/best-practices-containerizing-python-docker/
Hi,If I understand correctly your question, you want to extract data from CSV files (which have a specific name pattern) that are added incrementally to a folder, and create/update timeseries from those files. What I would recommend here is to build a CSV extractor using our “extractor-utils” package:https://cognite-extractor-utils.readthedocs-hosted.com/en/latest/index.htmlIn the docs there is a guide to build a CSV extractor. Of course you would have to change some logic inside of it, but I think this package has everything you need: reading CSV, upload queue, state store etc. I hope that was useful. If you have other questions, please let us know !
Just in case, you can find some guides on specific topics here:https://hub.cognite.com/how-to-guides-225It could be useful if you want to run your extractor with Docker, or deploy other kinds of extractors for example.
Hi,The DB extractor allows for running many queries, did you have a look at the logs ? Maybe there is something wrong with the first queries ? (setting your logger to DEBUG will probably give you more insights)
In the logs, you should see if the config was loaded correctly or not. Could you check? If you edited your file, it could be that some formatting is wrong now, and the extractor is still using the old version of the config
Nice article, Arild !
Hi,Can you try to add “LAST_UPDT_DATE” inside of the SELECT statement ? Please let us know if that works better. Best regards,
Hi,In the configuration file you shared, I can’t see any dash ( “-” ). Can you please add a dash in front of each “name” argument ? In a YAML file, each list element must start with a dash. (https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.htmlqueries: - name: query_one database: postgres query: > SELECT * FROM ITEM_PROPERTY WHERE PROPERTY_TYPE = "NAME" destination: database: "query_multiple" table: "raw_one" primary-key: "{ITEM_ID}-{PROPERTY_STRING}" - name: query_two database: postgres query: > SELECT * FROM ITEM_PROPERTY WHERE PROPERTY_TYPE = "PRODUCT" destination: database: "query_multiple" table: "raw_one" primary-key: "{ITEM_ID}-{PROPERTY_STRING}" Please try and let us know.Pierre
could you please share your whole query parameter ? including the incremental field ?
Hi,I would try something like that: (I assume you are using SQL Server, am I correct ?) - name: timeseries database: sqldb # same as above database query: SELECT * FROM ( SELECT ID + TYPE as "externalId", CAST(LAST_UPDT_DATE as timestamp) as timestamp, PROPERTY_VALUE as value FROM ITEM_TABLE WHERE START_DATETIME is not null and PROPERTY_VALUE is not null ) WHERE {incremental_field} is not null and {incremental_field} >= {start_at} ORDER BY {incremental_field} ASC incremental-field: timestamp schedule: "*/1 * * * *" initial-start: 1577836800000 destination-type: TIME_SERIESIf that does not work, please let us know and send us both the query and the logs, so we can help you debug.Also, I don’t know what your LAST_UPDT_DATE column looks like, you might have to adjust the CAST statements.
Hello Hakim, You can test for this error as follows. You will need to adapt the Pytest fixture to your needs. import pytestfrom cognite.client import CogniteClientfrom cognite.client.exceptions import CogniteAuthErrorfrom cognite.client.testing import monkeypatch_cognite_client@pytest.fixturedef cognite_client(): with monkeypatch_cognite_client() as client: client.assets.list.side_effect = CogniteAuthError yield clientdef test_auth_error(cognite_client: CogniteClient): with pytest.raises(CogniteAuthError): cognite_client.assets.list()Please let us know if you need more info. Pierre
Already have an account? Login
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.