Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make use_training_labels positional required #11529

Merged
merged 5 commits into from
May 21, 2020

Conversation

rakshith91
Copy link
Contributor

@rakshith91 rakshith91 commented May 19, 2020

Arch board suggestion in #11283

Rationale for making it positional is that I feel there is an obvious logical ordering between url and the use_training_label params. Also, "required" keyword-onlys are weird

@rakshith91 rakshith91 marked this pull request as ready for review May 19, 2020 20:56
@@ -79,8 +79,8 @@ def __init__(self, endpoint, credential, **kwargs):
)

@distributed_trace
def begin_train_model(self, training_files_url, use_training_labels=False, **kwargs):
# type: (str, Optional[bool], Any) -> LROPoller
def begin_train_model(self, training_files_url, use_training_labels, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the changelog?

self.assertEqual(len(model.training_documents), 1)
self.assertEqual(model.training_documents[0].document_name, "subfolder/Form_6.jpg") # we filtered for only subfolders

with self.assertRaises(HttpResponseError):
model = await client.train_model(training_files_url=container_sas_url, prefix="xxx")
model = await client.train_model(training_files_url=container_sas_url, use_training_labels=False, prefix="xxx")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update sample_train_model_without_labels (the sync and async)? they don't have use_training_labels set, and they also include a comment that the default is use_training_labels=False`

Can you also run the samples that call train_model (or begin_train_model), just to make 100% sure they pass with this new change? thanks!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we missing tests that use training labels (user_training_labels=True)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have the tests - just didnt need to update them

Copy link
Member

@johanste johanste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grudgingly approve :).

​​​​Yes, there is an order between URL and use_training_label. But if we ever have another required parameter, then it is unlikely that there is a logical order. But then again, that would also be a breaking change unless the new parameter was optional. 

@rakshith91
Copy link
Contributor Author

es, there is an order between URL and use_training_label. But if we ever have another required parameter, then it is unlikely that there is a logical order. But then again, that would also be a breaking change unless the new parameter was optional.

I think we can safely assume there won't be breaking changes after GA - atleast i know we will try to avoid - so another required param after GA seems highly unlikely.

@rakshith91
Copy link
Contributor Author

/azp run pythob - formrecognizer - ci

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@rakshith91
Copy link
Contributor Author

/check-enforcer evaluate

@rakshith91 rakshith91 merged commit bc01929 into Azure:master May 21, 2020
iscai-msft added a commit that referenced this pull request May 26, 2020
…into feature/text_analytics_v3.0

* 'master' of https://github.com/Azure/azure-sdk-for-python:
  Release azure mgmt containerregistry (#11460)
  Prepare core 1.6.0 on master (#11610)
  Add force parameter to SwaggerToSdk CLI (#11609)
  LRO continuation_token (#10801)
  Remove unecessary import (#11606)
  Fix Cleanup failing on 3.8.3 (#11607)
  remove DataSourceCredentials (#11605)
  Search synonym map (#11590)
  Fix copy tests (#11594)
  Make use_training_labels positional required (#11529)
  Search refactoring 2 (#11584)
  Search refactoring 1 (#11572)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants