-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fix PipelineOptionTest.test_display_data #25007
Conversation
Codecov Report
@@ Coverage Diff @@
## master #25007 +/- ##
==========================================
+ Coverage 65.20% 73.12% +7.91%
==========================================
Files 735 735
Lines 98146 98146
==========================================
+ Hits 64000 71769 +7769
+ Misses 32782 25013 -7769
Partials 1364 1364
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
2ff7c08
to
ae0b68c
Compare
ref: https://stackoverflow.com/questions/52428679/how-to-remove-classes-from-subclasses tested this approach should work. Code snippet: from apache_beam.options.pipeline_options import PipelineOptions
class PipelineOptionTest:
class UserDefinedOptions(PipelineOptions):
@classmethod
def _add_argparse_args(cls, parser):
parser.add_value_provider_argument('--gcs_location')
@classmethod
def setUpClass(cls):
cls.UserDefinedOptions = PipelineOptionTest.UserDefinedOptions
def tearDown(self):
# Unset the option added in setupClass to avoid interfere with other tests
del PipelineOptionTest.UserDefinedOptions
import gc
gc.collect()
def run(self):
print(PipelineOptions.__subclasses__())
x = PipelineOptions().get_all_options()
print(x)
if __name__ == '__main__':
test_instance = PipelineOptionTest()
test_instance.setUpClass()
test_instance.run()
test_instance.tearDown()
test_instance.run() output: {'runner': None, ... 's3_region_name': None, 's3_api_version': None, 's3_verify': None, 's3_disable_ssl': False, 'gcs_location': <apache_beam.options.value_provider.RuntimeValueProvider object at 0x1288d3c70>} as can be seen the second run there is no longer |
ae0b68c
to
8e14be3
Compare
Assigning reviewers. If you would like to opt out of this review, comment R: @damccorm for label python. Available commands:
The PR bot will only process comments in the main thread (not review comments). |
R: @damccorm |
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find!
Fixes #21116
Please add a meaningful description for your change here
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
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, commentfixes #<ISSUE NUMBER>
instead.CHANGES.md
with noteworthy changes.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)
See CI.md for more information about GitHub Actions CI.