cancel
Showing results for 
Search instead for 
Did you mean: 

Error assigning new segment champion in the API

Error assigning new segment champion in the API

I am trying to assign a new Segment Champion using the API and I am running into this error:

Exception: 422 client error: {'message': 'Invalid field data', 'errors': {'clone': 'clone is not allowed key'}}

Below is the code that is causing the error, any ideas on why this is happening/how I can fix this?

 

        if best.id != dr.Model.get(s_project.id, s.model_id).id:
            try:
                print('Setting new champion for {}: {} instead of {}'.format(s_project.project_name, best.model_type, dr.Model.get(s.project_id, s.model_id).model_type))
                CombinedModel.set_segment_champion(project_id = s_project.id, model_id = best.id, clone = True)
            except Exception as e:
                print('Error assigning new champion')
                print('Exception: {}'.format(e))
Labels (1)
3 Replies

Hi, Tyler!

 

May you check your datarobot module version?

 

dr.__version__

 

If it's below 3.0.2 - try upgrading. If error remains - try to raise this error to support team.

0 Kudos

Hi there,

 

I am taking a look at the docs for `set_segment_champion()` here and do indeed see the boolean `clone` argument:

https://datarobot-public-api-client.readthedocs-hosted.com/en/v3.0.2/autodoc/api_reference.html?high...

 

As I can see those docs the clone argument says:

(New in version v2.29)

 

Are you using a version of DataRobot that is v2.28 or lower?

If so maybe you might want to use an earlier version of the python client like 2.28.1

https://pypi.org/project/datarobot/2.28.1/

 

0 Kudos

Sorry for the confusion - to reiterate I'd suggest checking the DR (non-python client) version you're using to see if `clone` is available.

 

And again, if not you might need an _earlier_ version of the Python Client