cancel
Showing results for 
Search instead for 
Did you mean: 

A problem creating a relationship configuration using the AP

A problem creating a relationship configuration using the AP

Dear Community!

 

I'm playing around with the automated feature discovery. I'm trying to reproduce the way it's done in this learning session

My goal is to reproduce the case using the Data Robot's REST API. In the video, it was done with the python lib but I guess that it's just a wrapper on top of the API.

So far I managed to:

  1. Create 3 datasets from files. 
  2. Create a project based on one of my data sets

The next step for me is to join 2 secondary data sets to the primary one (the one I use to create a project), but I'm getting a validation error that says "dataset ds_file_poc_scope not connected to primary dataset".  But the dataset `ds_file_poc_scope` is my primary data set that I used to create a project. The request I made:

POST /api/v2/relationshipsConfigurations/
{
   "datasetDefinitions":[
      {
         "identifier":"ds_file_poc_scope",
         "catalogId":"602e54dddab37f56b6024ed8",
         "catalogVersionId":"602e54dddab37f56b6024ed9"
      },
      {
         "identifier":"ds_file_poc_contacts",
         "catalogId":"602e5524e5e09956c24dd671",
         "catalogVersionId":"602e5525e5e09956c24dd672"
      },
      {
         "identifier":"ds_file_poc_offers",
         "catalogId":"602e552879462f55e3024ede",
         "catalogVersionId":"602e552979462f55e3024edf"
      }
   ],
   "relationships":[
      {
         "dataset2Identifier":"ds_file_poc_contacts",
         "dataset1Keys":[
            "contact-id"
         ],
         "dataset2Keys":[
            "contact-id"
         ]
      },
      {
         "dataset2Identifier":"ds_file_poc_offers",
         "dataset1Keys":[
            "Offer"
         ],
         "dataset2Keys":[
            "OfferID"
         ]
      }
   ]
}

The response I got: 

{
   "message":"Invalid field data",
   "errors":{
      "datasetDefinitions":{
         "0":"dataset ds_file_poc_scope not connected to primary dataset"
      }
   }
}

 

How can I mark my dataset as primary to avoid this error?

1 Solution

Accepted Solutions
joao
Data Scientist
Data Scientist

Dear @evgeni,
Yes, you will be able to use the REST API.

I see in your relationship configuration that you are linking ds_file_poc_contacts and ds_file_poc_offers but not ds_file_poc_scope. If ds_file_poc_scope is a secondary dataset then you should link it, otherwise you should remove it.

The primary dataset is indeed the one you used in your project so you don't need it in the secondary dataset definitions.

The link I’ve shared with you here is code from the learning session.

Hope it helps to clarify the relationship configuration syntax. Let me know if this helps to get this working for you.

Thanks

View solution in original post

4 Replies
joao
Data Scientist
Data Scientist

Dear @evgeni,
Yes, you will be able to use the REST API.

I see in your relationship configuration that you are linking ds_file_poc_contacts and ds_file_poc_offers but not ds_file_poc_scope. If ds_file_poc_scope is a secondary dataset then you should link it, otherwise you should remove it.

The primary dataset is indeed the one you used in your project so you don't need it in the secondary dataset definitions.

The link I’ve shared with you here is code from the learning session.

Hope it helps to clarify the relationship configuration syntax. Let me know if this helps to get this working for you.

Thanks

Hi, @joao !

Thanks for the source code, now I'm able to see the difference. I removed ds_file_poc_scope from the data set definitions, but now I'm getting a new error:

{
   "message":"Invalid field data",
   "errors":{
      "relationships":{
         "0":{
            "dataset2Identifier":"dataset key 'contact-id' do not exist in dataset ds_file_poc_contacts"
         }
      }
   }
}

 maybe it's due to the column naming. I will look how these files are looking in the Data Robot UI to confirm this

0 Kudos

Yes, that was a naming issue. Data Robot renamed my original `contact-id` into `contact_id`. Now when I'm using the correct column name it works perfectly

0 Kudos

Hi @evgeni 
Happy to hear it's working for you now!
As for the unexpected column-rename, - is not allowed, more details in https://app.datarobot.com/docs/load/file-types.html
Please reach out if you have any more questions.