Impact 2024: The Industrial Data and AI Conference for and by Users | Nominate Speakers Now for a Ch...
I guess you are trying to create assets.From the error message, you are missing permissions to read/write assets. You would need to add that capability
Glad to hear. Thanks for the feedback
@Kathrine Muszynski do you have any feedback on Sunil’s feedback?
Thanks for the feedback @Andreea Pastinaru , we will provide an example
Hi ChrisSince your input date format is not consistent, we need to deconstruct the date and rebuild it to_timestamp( --- concat day,month,year,hour,minutes,second according to the expected format concat( -- get the day (first element split on "-") and append 0 if necessary lpad(split(DateTimeStamp, "-") [0], 2, 0), "-", -- get the month (second element split on "-") and append 0 if necessary lpad(split(DateTimeStamp, "-") [1], 2, 0), "-", -- get the year (third element split on "-" before the space) and append 0 if necessary lpad(split(split(DateTimeStamp, "-") [2], " ") [0], 4, 0), " ", -- get the hour (first element split on ":" after the space) and append 0 if necessary lpad(split(split(DateTimeStamp, " ") [1], ":") [0], 2, 0), ":", -- get the minutes (second element split on ":" after the space) and append 0 if necessary lpad(split(split(DateTimeStamp, " ") [1], ":") [1], 2, 0), ":", -- get the s
Great to hear you found a solution :) And thanks for the update
Hi,You can find some information on this repositoryhttps://github.com/cognitedata/functions-deploy-azure-pipelinesAnd particularly this file for azure devops pipelinehttps://github.com/cognitedata/functions-deploy-azure-pipelines/blob/main/azure-pipelines.yaml Any questions, please let us know
Did you associate the timeseries to the dataset in the code of the transformation? The dataset of the transformation could be different to the dataset of the objects you are transforming in your transformation code.Can you share your transformation code?
If you want to update the timeseries and assign them to a different dataset, you can add this line(replacing 1234556 with the dataSetId of your dataset)1234556 as dataSetId,
Hi Chris,I guess the “to_timestamp” is not able to convert the DateTimeStamp on the specified formatIf you comment the last line again and print DateTimeStamp, something like thatdp.Tagname AS externalId,to_timestamp(DateTimeStamp, 'yyyy-M-d h:mm:ss') AS timestamp,DateTimeStamp as DateTimeStamp, cast(value AS double) And see what the format of DateTimeStamp look like, I would assume it is not 'yyyy-M-d h:mm:ss' ? You can also test that date you get directly with the timestamp function and try to find the right format. Potentially have to use something like what we suggested here? Let me know how the DateTimeStamp look like and we can see
Hi, we have a released a new version (1.2.4)Let me know if you still have an issue or if that is fixed
Can you try to run client.iam.token.inspect()it should list all the capabilities that you have
Yes, so it looks like you have no capabilities,Which Azure AD group does your user belong to? And which CDF group is that AD group connected to? There is most likely something incorrect there
Under projects, it should list the projects you have access to and then the capabilities for each of the project. So I would check if: you or the service account you are using is member of the Azure AD groups the Azure AD group is linked to the CDF group { "subject": "xxxxxxx", "projects": [ { "url_name": "project1", "groups": [ 123456789, 123456788, 123456787 ] }, { "url_name": "project2", "groups": [ 123456789, 123456788, 123456787 ] } ], "capabilities": [ { "projectsAcl": { "version": 1, "actions": [ "UPDATE", "LIST", "READ" ], "scope": { "all": {} } }, "projectScope": { "projects": [
I cannot see all the capabilities, but do you have “groups:list” and “project:list” as part of the capabilities? And for the code you are trying to run, you also need “datasets:list” (if you dont have it)Can you also share the code you use to create the client object?
yes, sorry datasets:list was a typo, i meant datasets:read However, you are not authenticating with your user since you are using clientID/client secretI will refer you for more information https://docs.cognite.com/cdf/access/concepts/authentication_flows_oidcFor your case, you need the app registration with client ID “d5912468-12f6-4b74-abe7-3948cf8d731a” to be also part of the Azure AD group. Also, since you shared a secret in the snippet above, I would recommend deleting that secret and regenerating a new one. If you would like to log in on behalf of your user, you can use this guide to set up an app registration for that, in this case you will not need a client secrethttps://docs.cognite.com/dev/guides/sdk/python/register_app_jupyter_sdk
Hi @joseLB When using Google Collab, you cannot sign in interactively via a browser and use the authenticate with interactive login and token refresh flow, you need to use another authentication method.Just scroll down a bit more to the section “Using Device Code” and run the code there. It will provide you an url and a code to connect in your browser. Hope that helps, let me know if any questions
Once successfully logged in, you can use client.iam.token.inspect()to verify your capabilities.
Not sure I fully understand the question, but if you need to deploy to separate projects, I guess you can add multiple “Deploy Functions to CDF” steps in the pipeline, each pointing to different secrets/clientID/tenantID
I think you should be able to do that by having a different pipeline trigger, for example deploy to test with a "pull request trigger", test it and merge it to master after approval which would then deploy to production
Can you send your code snippet containing the is_new query?For reference, it should be a timestamp, we usually use lastUpdatedTimehttps://docs.cognite.com/cdf/integration/guides/transformation/write_sql_queries/#is_new
Great to hear. Thanks for the feedback
Thanks for your feedback. It seems like an access right issue. Did you generate a secret and added it to the code? Did you encounter any errors earlier in the notebook, like in the first steps on the print(client.iam.token.inspect().projects)And what information do you get viaprint(client.iam.token.inspect())
Yes I agree with Roman@Philips under the section Create credentials for use in Transformations, could you try to run this code?This will try to authenticate with the client secret provided above in the notebookfrom cognite.client.data_classes import OidcCredentialscreds = OidcCredentials( client_id = CLIENT_ID, client_secret = CLIENT_SECRET, scopes = " ".join(SCOPES), token_uri = f"{AUTHORITY_URI}/oauth2/v2.0/token", cdf_project_name = COGNITE_PROJECT)cnf_secret = ClientConfig( client_name="test-client", base_url=f"https://{CDF_CLUSTER}.cognitedata.com", project=COGNITE_PROJECT, credentials=creds,)client_secret_auth = CogniteClient(cnf_secret)print(client_secret_auth.iam.token.inspect())
The token inspect you printed is actually authenticated with your user, but great that works
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.