Skip to content

Commit 2ab8142

Browse files
authored
dataflow: update dataflow flags (GoogleCloudPlatform#9887)
## Description Related to GoogleCloudPlatform#9830 Fix the python version used to run the tests and simplify the Dataflow pipeline flags to not use a custom container. Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google. ## Checklist - [ ] I have followed [Sample Guidelines from AUTHORING_GUIDE.MD](https://togithub.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md) - [ ] README is updated to include [all relevant information](https://togithub.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md#readme-file) - [ ] **Tests** pass: `nox -s py-3.9` (see [Test Environment Setup](https://togithub.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md#test-environment-setup)) - [ ] **Lint** pass: `nox -s lint` (see [Test Environment Setup](https://togithub.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md#test-environment-setup)) - [ ] These samples need a new **API enabled** in testing projects to pass (let us know which ones) - [ ] These samples need a new/updated **env vars** in testing projects set to pass (let us know which ones) - [ ] This sample adds a new sample directory, and I updated the [CODEOWNERS file](https://togithub.com/GoogleCloudPlatform/python-docs-samples/blob/main/.github/CODEOWNERS) with the codeowners for this sample - [ ] This sample adds a new **Product API**, and I updated the [Blunderbuss issue/PR auto-assigner](https://togithub.com/GoogleCloudPlatform/python-docs-samples/blob/main/.github/blunderbuss.yml) with the codeowners for this sample - [ ] Please **merge** this PR for me once it is approved
1 parent 7c9b968 commit 2ab8142

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

people-and-planet-ai/timeseries-classification/create_datasets.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ def run(
4141
]
4242
).sort_values(by="start_time")
4343

44-
beam_options = PipelineOptions(flags=[], **beam_args)
44+
beam_options = PipelineOptions(
45+
flags=[],
46+
save_main_session=True,
47+
requirements_file="requirements.txt",
48+
**beam_args,
49+
)
4550
pipeline = beam.Pipeline(options=beam_options)
4651

4752
training_data, evaluation_data = (

people-and-planet-ai/timeseries-classification/main.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,9 @@ def run_create_datasets() -> dict:
6464
runner_params = {
6565
"runner": "DataflowRunner",
6666
"job_name": f"global-fishing-watch-create-datasets-{datetime.now().strftime('%Y%m%d-%H%M%S')}",
67-
"save_main_session": args.get("save_main_session", True),
68-
"sdk_container_image": args.get("container_image", CONTAINER_IMAGE),
6967
"project": args.get("project", PROJECT),
7068
"region": args.get("region", REGION),
7169
"temp_location": args.get("temp_location", TEMP_DIR),
72-
"experiments": ["use_runner_v2"],
7370
}
7471
params = {
7572
"raw_data_dir": args.get("raw_data_dir", RAW_DATA_DIR),

people-and-planet-ai/timeseries-classification/noxfile_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222

2323
TEST_CONFIG_OVERRIDE = {
2424
# You can opt out from the test for specific Python versions.
25-
# > ℹ️ Test only on Python 3.9.
25+
# > ℹ️ Test only on Python 3.10.
2626
# > The Python version used is defined by the Dockerfile, so it's redundant
2727
# > to run multiple tests since they would all be running the same Dockerfile.
28-
"ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.10", "3.11"],
28+
"ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.11"],
2929
# Old samples are opted out of enforcing Python type hints
3030
# All new samples should feature them
3131
"enforce_type_hints": True,

0 commit comments

Comments
 (0)