-
Notifications
You must be signed in to change notification settings - Fork 6.6k
fix: add mains to samples #3284
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
5557be9
Added mains to samples
bradmiro 9740aab
bug fix
bradmiro 08e06e7
Checked for arg count and revert tests
bradmiro b760c46
lint fixes
bradmiro 821e407
moved region tags
bradmiro 1f615a2
Fix mains and remove subprocess from quickstart test
bradmiro d15e2d1
Merge branch 'master' into dataproc_samples_iiwt_fix
bradmiro a961de3
fix error message in create cluster
bradmiro 51ef9fa
Merge branch 'dataproc_samples_iiwt_fix' of https://github.com/Google…
bradmiro 75cc885
Merge branch 'master' into dataproc_samples_iiwt_fix
bradmiro c041db7
Merge branch 'master' into dataproc_samples_iiwt_fix
leahecole 46991f4
replaced .format with fstrings
bradmiro f526bc8
add fstring to test
bradmiro 0dbf815
fixed create_cluster_test
bradmiro edb489c
Merge branch 'master' into dataproc_samples_iiwt_fix
bradmiro 49023a8
Merge branch 'master' into dataproc_samples_iiwt_fix
bradmiro 881bc90
Merge branch 'master' into dataproc_samples_iiwt_fix
bradmiro cc520db
Merge branch 'master' into dataproc_samples_iiwt_fix
bradmiro bbe372e
Merge branch 'master' into dataproc_samples_iiwt_fix
bradmiro 8ccb874
Merge branch 'master' into dataproc_samples_iiwt_fix
bradmiro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,9 +16,11 @@ | |
# workflow for Cloud Dataproc using the Python client library. | ||
# | ||
# This script can be run on its own: | ||
# python workflows.py ${PROJECT_ID} ${REGION} | ||
# python instantiate_inline_workflow_template.py ${PROJECT_ID} ${REGION} | ||
|
||
|
||
import sys | ||
|
||
# [START dataproc_instantiate_inline_workflow_template] | ||
from google.cloud import dataproc_v1 as dataproc | ||
|
||
|
@@ -35,7 +37,8 @@ def instantiate_inline_workflow_template(project_id, region): | |
# Create a client with the endpoint set to the desired region. | ||
workflow_template_client = dataproc.WorkflowTemplateServiceClient( | ||
client_options={ | ||
'api_endpoint': '{}-dataproc.googleapis.com:443'.format(region)} | ||
'api_endpoint': f'{region}-dataproc.googleapis.com:443' | ||
} | ||
) | ||
|
||
parent = workflow_template_client.region_path(project_id, region) | ||
|
@@ -91,8 +94,14 @@ def instantiate_inline_workflow_template(project_id, region): | |
|
||
# Output a success message. | ||
print('Workflow ran successfully.') | ||
# [END dataproc_instantiate_inline_workflow_template] | ||
# [END dataproc_instantiate_inline_workflow_template] | ||
|
||
|
||
if __name__ == "__main__": | ||
instantiate_inline_workflow_template(sys.argv[1], sys.argv[2]) | ||
if len(sys.argv) < 3: | ||
sys.exit('python instantiate_inline_workflow_template.py ' | ||
+ 'project_id region') | ||
|
||
project_id = sys.argv[1] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
region = sys.argv[2] | ||
instantiate_inline_workflow_template(project_id, region) |
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
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.
Uh oh!
There was an error while loading. Please reload this page.