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

feat: enabling AutoML Forecasting training response to include BigQuery location of exported evaluated examples #657

Merged
22 commits merged into from
Oct 14, 2021

Conversation

mansiachuthan
Copy link
Contributor

We currently do not support the output of a BigQuery destination uri for the exported evaluated examples from our training step when creating an AutoML Forecast model. Adding this feature would allow users to easily access the evaluated examples and use them for data visualization.

@product-auto-label product-auto-label bot added the api: aiplatform Issues related to the AI Platform API. label Aug 25, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Aug 25, 2021
@mansiachuthan mansiachuthan marked this pull request as ready for review August 25, 2021 22:53
@mansiachuthan mansiachuthan changed the title feat: enabling AutoML Forecasting training response to include BigQuery location of exported evaluated examples feat: enabling AutoML Forecasting training response to include BigQuery location of exported evaluated examples [NOT READY TO MERGE] Aug 25, 2021
@vinnysenthil vinnysenthil added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Aug 26, 2021
@mansiachuthan mansiachuthan changed the title feat: enabling AutoML Forecasting training response to include BigQuery location of exported evaluated examples [NOT READY TO MERGE] feat: enabling AutoML Forecasting training response to include BigQuery location of exported evaluated examples Aug 30, 2021
@vinnysenthil vinnysenthil removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Aug 30, 2021
Copy link
Contributor

@vinnysenthil vinnysenthil left a comment

Choose a reason for hiding this comment

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

Thanks Mansi! Added one comment. Could you also run nox -s lint in the repo root? Looks like you need to run black on training_jobs.py

Comment on lines 4152 to 4156
try:
meta = getattr((self._gca_resource), "training_task_metadata")
except ValueError:
raise ValueError("BigQuery uri for evaluated data items does not exist. Must export evaluated data items during training.")

Copy link
Contributor

Choose a reason for hiding this comment

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

This can be removed as the try/except below already covers the logic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed try/except block.

mansiachuthan and others added 2 commits August 30, 2021 16:53
Removed the unnecessary try/except block from the evaluated bigquery uri property method in Automl Forecasting
@mansiachuthan
Copy link
Contributor Author

nox -s lint has been successfully run in root of repo

Copy link
Member

@sasha-gitg sasha-gitg left a comment

Choose a reason for hiding this comment

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

Please update the unit tests.

@@ -4138,6 +4146,20 @@ def _model_upload_fail_string(self) -> str:
"Model."
)

@property
def evaluated_data_items_bigquery_uri(self) -> Optional[str]:
Copy link
Member

Choose a reason for hiding this comment

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

What are the scenarios where this method:

  1. returns str
  2. returns None
  3. raises ValueError

Copy link

Choose a reason for hiding this comment

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

Updated the method doc string.

google/cloud/aiplatform/training_jobs.py Show resolved Hide resolved
try:
metadata = self._gca_resource.training_task_metadata
return metadata["evaluatedDataItemsBigqueryUri"]
except (AttributeError, KeyError):
Copy link
Member

Choose a reason for hiding this comment

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

Why both AttributeError and KeyError?

Copy link

Choose a reason for hiding this comment

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

Corrected.

@@ -4138,6 +4146,20 @@ def _model_upload_fail_string(self) -> str:
"Model."
)

@property
def evaluated_data_items_bigquery_uri(self) -> Optional[str]:
"""BigQuery location of exported evaluated examples from the Training Job"""
Copy link
Member

Choose a reason for hiding this comment

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

Raises section.

Copy link

Choose a reason for hiding this comment

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

No longer needed.

@ivanmkc
Copy link
Contributor

ivanmkc commented Sep 20, 2021

@mansiachuthan Any updates on this?

@mansiachuthan
Copy link
Contributor Author

Hello @ivanmkc @sasha-gitg! I just wanted to let you know that my internship ended a few weeks ago and I am currently not working on this PR. I would like to request my mentor @thehardikv to answer any future comments/questions for this pull request, as I would love to see that these changes get merged. Thank you!

@google-cla
Copy link

google-cla bot commented Sep 23, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Sep 23, 2021
@ghost
Copy link

ghost commented Sep 23, 2021

@googlebot I signed it!

@google-cla
Copy link

google-cla bot commented Sep 23, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

1 similar comment
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

Copy link
Member

@sasha-gitg sasha-gitg left a comment

Choose a reason for hiding this comment

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

One requested change. @thehardikv It seems like this PR may need to closed and opened as a new PR as the CLA bot may be complaining about
mansiachuthan.

self._assert_gca_resource_is_available()

metadata = self._gca_resource.training_task_metadata
if "evaluatedDataItemsBigqueryUri" in metadata:
Copy link
Member

Choose a reason for hiding this comment

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

Safer to do this: if metadata and "evaluatedDataItemsBigqueryUri" in metadata:

See this issue b/192601601. training_task_metadata may not be populated by the service.

Copy link

Choose a reason for hiding this comment

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

Done.

@ghost
Copy link

ghost commented Oct 4, 2021

@sasha-gitg Before I jump to copying over your changes to a fresh PR (and eliminating the commit history and credit attribution), we're going to try vinnysenthil@'s suggestion: mansiachuthan@ is going to update all the commits to use a personal gmail account (doing something like this: https://stackoverflow.com/a/750182) and to sign the individual Google CLA with that email address here: https://cla.developers.google.com/clas. It's currently using the default no-reply email. Looks like go/github used to associate the @google.com email to mansiachuthan@'s github username, but no longer does.

@google-cla
Copy link

google-cla bot commented Oct 12, 2021

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Oct 12, 2021
@google-cla
Copy link

google-cla bot commented Oct 12, 2021

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@google-cla
Copy link

google-cla bot commented Oct 12, 2021

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@google-cla
Copy link

google-cla bot commented Oct 14, 2021

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@vinnysenthil vinnysenthil added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 14, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 14, 2021
@ghost ghost merged commit c1c2326 into googleapis:main Oct 14, 2021
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: aiplatform Issues related to the AI Platform API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants