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

[Python]Remove get_artifacts in MLTranform since artifacts are stored in artifact location #29016

Merged
merged 11 commits into from
Oct 25, 2023

Conversation

AnandInguva
Copy link
Contributor

@AnandInguva AnandInguva commented Oct 16, 2023

MLTransform outputs artifacts in the output dictionary. Initially, it was designed to provide users artifacts such as min and max values from the transform ScaleTo01. Now since the concept of artifact location is used, we store the artifacts directly in the artifact location and provide the user the option of read_artifact_location in MLTransform.

In the efforts of read and write artifact location, let us remove outputting artifacts in the output dict since they might create noise in the user data. This is a breaking change but since MLTransform is not yet launched and possibly, there is no usage yet, I would like to mention this in CHANGES.md and merge the breaking changes.

Note: The artifacts are embedded in a TF graph and it is easier to read and use them with MLTransform.

Filed #29017 to export MLTransform artifacts in human readable format along with TF graph.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@codecov
Copy link

codecov bot commented Oct 16, 2023

Codecov Report

Merging #29016 (6472ba7) into master (fddab44) will decrease coverage by 0.02%.
Report is 113 commits behind head on master.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master   #29016      +/-   ##
==========================================
- Coverage   38.41%   38.39%   -0.02%     
==========================================
  Files         686      686              
  Lines      101614   101656      +42     
==========================================
- Hits        39033    39032       -1     
- Misses      60999    61042      +43     
  Partials     1582     1582              
Flag Coverage Δ
python 29.99% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
sdks/python/apache_beam/ml/transforms/base.py 0.00% <ø> (ø)
sdks/python/apache_beam/ml/transforms/tft.py 0.00% <0.00%> (ø)

... and 12 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@AnandInguva
Copy link
Contributor Author

Run Python PreCommit 3.8

@AnandInguva
Copy link
Contributor Author

Run Python_Integration PreCommit 3.8

@AnandInguva
Copy link
Contributor Author

Run Python_Integration PreCommit

@AnandInguva
Copy link
Contributor Author

Run Python_Runners PreCommit

@AnandInguva AnandInguva marked this pull request as ready for review October 18, 2023 17:44
@AnandInguva
Copy link
Contributor Author

R: @damccorm

@github-actions
Copy link
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control

sdks/python/apache_beam/ml/transforms/tft.py Outdated Show resolved Hide resolved
@@ -130,7 +125,6 @@ def test_ScaleTo01_list(self):
| "MLTransform" >> base.MLTransform(
write_artifact_location=self.artifact_location).with_transform(
tft.ScaleTo01(columns=['x'])))
_ = (list_result | beam.Map(assert_ScaleTo01_artifacts))
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than removing all of these checks, can we check that the written artifact is correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added #29017 to do this but for now, we will have to use some TF tools to do it. It is not clear how to do it but it is not straight forward.

To read the artifacts, we use read_artifact_location and there are tests covering this path.

sdks/python/apache_beam/ml/transforms/tft.py Show resolved Hide resolved
@AnandInguva AnandInguva added this to the 2.52.0 Release milestone Oct 19, 2023
Copy link
Contributor

@damccorm damccorm left a comment

Choose a reason for hiding this comment

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

LGTM outside of one minor suggestion (and getting checks green)

@AnandInguva AnandInguva merged commit 8b31859 into apache:master Oct 25, 2023
87 of 89 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants