feat: add timeout arg across SDK#1099
Merged
Merged
Conversation
sasha-gitg
approved these changes
Mar 30, 2022
Member
sasha-gitg
left a comment
There was a problem hiding this comment.
LGTM with minor comments. Thanks Sara!
| Overrides encryption_spec_key_name set in aiplatform.init. | ||
| create_request_timeout (float): | ||
| Optional. The timeout for initiating this create request in seconds. Note: | ||
| this does not set the timeout on the underlying create job, only on the time |
Member
There was a problem hiding this comment.
Preference to reduce this docstring to The timeout for the create request in seconds. throughout.
| # import_request_timeout is None since user is issuing a single request with create and import | ||
| if isinstance(datasource, _datasources.DatasourceImportable): | ||
| dataset_obj._import_and_wait(datasource) | ||
| dataset_obj._import_and_wait(datasource, import_request_timeout=None) |
Member
There was a problem hiding this comment.
Preference to handle this as a default in _import_and_wait instead of passing None directly.
Contributor
Author
There was a problem hiding this comment.
In this case should create() accept both create_request_timeout and import_request_timeout parameters?
| return dataset_obj | ||
|
|
||
| def _import_and_wait(self, datasource): | ||
| def _import_and_wait(self, datasource, import_request_timeout): |
Member
There was a problem hiding this comment.
Preference to use this chance to include a docstring and type hints.
sasha-gitg
approved these changes
Apr 1, 2022
4 tasks
gcf-merge-on-green Bot
pushed a commit
that referenced
this pull request
May 27, 2022
Adds e2e test for AutoML Forecasting and unit test for `TimeSeriesDataset`. Also adds `create_request_timeout` to `TimeSeriesDataset`, which #1099 seems to have missed. --- Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [x] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/python-aiplatform/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [x] Ensure the tests and linter pass - [x] Code coverage does not decrease (if any source code was changed) - [x] Appropriate docs were updated (if necessary) Fixes #<issue_number_goes_here> 🦕
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses b/225964107 🦕
I added a
timeoutarg and relevant tests to these methods:Model.uploadModel.deployPipelineJob.submit*TrainingJob.runCustomJob.runHyperparameterTuningJob.runBatchPredictionJob.create*Dataset.create*Dataset.import_dataTensorboard.createTensorboardExperiment.createTensorboardRun.createFeaturestore.createFeaturestore.create_entity_typeFeaturestore.updateFeaturestore.batch_serve_to_bqFeaturestore.batch_serve_to_gcsFeaturestore.batch_serve_to_dfEntityType.createEntityType.updateEntityType.readEntityType.create_featureEntityType.batch_create_featuresEntityType.ingest_from_bqEntityType.ingest_from_gcsEntityType.ingest_from_dfFeature.createFeature.updateFor most of these methods, I gave the timeout arg a name specific to the method (i.e.
upload_request_timeout) to differentiate the timeout of initiating the request (what this PR applies to) vs. the timeout of the underlying job.