Skip to main content
Seasoned ⭐️⭐️⭐️
February 22, 2023
Solved

transformations-cli with FDM

  • February 22, 2023
  • 17 replies
  • 385 views

Hi,

I am trying to run transformations-cli locally with below command:

transformations-cli deploy . 

(The current directory has manifest.yaml and transformation.sql files)

 

I am getting below error:

Deploying transformations...
Failed to parse transformation config, please check that you conform required fields and format: Invalid config: can not match type "dict" to any type of "destination" union: typing.Union[cognite.transformations_cli.commands.deploy.transformation_types.DestinationType, cognite.transformations_cli.commands.deploy.transformation_types.DestinationConfig, cognite.transformations_cli.commands.deploy.transformation_types.RawDestinationConfig, cognite.transformations_cli.commands.deploy.transformation_types.SequenceRowsDestinationConfig, cognite.transformations_cli.commands.deploy.transformation_types.AlphaDMIDestinationConfig]

 

Here is destination section of manifest file:

destination:
  viewSpaceExternalId: my-model-space-id
  viewExternalId: CDFTimeSeries
  viewVersion: 0_2
  instanceSpaceExternalId: my-model-space-id
  type: instances

 

Please let me know if I am missing anything.

 

Thanks

 

Best answer by Dilini Fernando

Hi @Niranjan Madhukar Karvekar,

I hope Jason’s reply has helped you to solve the issue. As of now, I will close this thread. Please feel free to create a new post if you still experience problems.

Br,
Dilini

17 replies

Seasoned ⭐️⭐️⭐️
March 6, 2023

I tried that as well, but I still the same issue.

 

 

 

 

Practitioner ⭐️⭐️⭐️
March 9, 2023

Can you give me the uuid string of the request Id?
Should be the one with xxxx in your error log.
I can try to see with auth team why that request is rejected

Seasoned ⭐️⭐️⭐️
March 10, 2023

Hi,

Here is the request id : 099cefef-6bc9-98c0-8122-68076440353c

 

 

Expert ⭐️⭐️⭐️⭐️
March 23, 2023

Hello Niranjan,
I created a working sample I hope helps. I created an FDM targeted transformation in Fusion (version as of the date I wrote this) and used the export CLI button in the upper right. This created the following manifest.  I updated authentication section with the credentials that are required when the transformation itself is going to run.  This auth

# Manifest file downloaded from fusion
externalId: tr-BSEEWell-Header-Asset-FDM-cli
name: BSEE Well Header Asset - FDM - CLI
query: >-
select
cast(`API_WELL_NUMBER` as STRING) as externalId,
cast(`WELL_NAME` as STRING) as name,
cast(`API_WELL_NUMBER` as STRING) as apiNumber
from
`bsee`.`well_header`;
destination:
view:
space: space-well-model-simple
externalId: Well
version: "1"
instanceSpace: space-well-model-simple
type: nodes
ignoreNullFields: true
shared: true
action: upsert
dataSetExternalId: ds-bsee

# this is authentication credentials for Fusion, not the transformation-cli
authentication:
clientId: mycliendid
clientSecret: myclientsecret
tokenUrl: https://login.microsoftonline.com/mytenantid/oauth2/v2.0/token
# Optional: If idP requires providing the scopes
cdfProjectName: cdf_project
scopes:
- https://api.cognitedata.com/.default

Regarding cognite-transformation-cli itself:

 

  • I”m using a virtual python environment (version 3.10.5)
  • I ran pip install cognite-transformations-cli in the above environment and confirmed that the version (transformations-cli --version) of the cli is  2.3.3
  • I sourced the following shell script my path:
    #!/bin/sh

    export TRANSFORMATIONS_CLIENT_ID=myclientid
    export TRANSFORMATIONS_CLIENT_SECRET=myclientsecret
    export TRANSFORMATIONS_TOKEN_URL=https://login.microsoftonline.com/mytentantid/oauth2/v2.0/token
    export TRANSFORMATIONS_PROJECT=mycdfproject
    export TRANSFORMATIONS_CLUSTER=api
    export TRANSFORMATIONS_SCOPES=https://api.cognitedata.com/.default
  • Run env at the command line to ensure you have the correct environment variables set:
  • Run transformations-cli list.  This will list all transformations in the target project and will confirm you are correctly authenticated.
  • Lastly, run transformations-cli deploy ./my-transformations to deploy your transformations to CDF.  The my-transformation folder contains the .yaml file containing the manifest above.
  • Confirm the transformation has been deployed to your CDF project.

Hope this helps!

Jason

Dilini Fernando
Expert ⭐️⭐️⭐️⭐️
Expert ⭐️⭐️⭐️⭐️
April 7, 2023

Hi @Niranjan Madhukar Karvekar,

Please let us know if you are able to try out Jason’s solution and if you are able to solve the issue. 

Br,
Dilini 

Dilini Fernando
Expert ⭐️⭐️⭐️⭐️
Expert ⭐️⭐️⭐️⭐️
April 18, 2023

Hi @Niranjan Madhukar Karvekar,

I hope Jason’s reply has helped you to solve the issue. As of now, I will close this thread. Please feel free to create a new post if you still experience problems.

Br,
Dilini

Seasoned ⭐️⭐️⭐️
April 21, 2023

Hi @Dilini Fernando


We have tried the steps mentioned in the Jason’s reply yet getting 401 error.


Sharing X-Request-ID for reference.
 

 Unauthorized | code: 401 | X-Request-ID: 2fc9c103-6de0-9ae2-bb38-f65110f66fed

Regards,

Sonali