Skip to content

Commit

Permalink
refactor according to code review
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeWang1127 committed Oct 13, 2023
1 parent 8ff3538 commit 7c32834
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
3 changes: 1 addition & 2 deletions synthtool/gcp/partials.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ def load_partials(files: List[str] = []) -> Dict:
deprecation_warning: a warning to indicate that the library has been
deprecated and a pointer to an alternate option
"""
files = (files or []) + _DEFAULT_PARTIAL_FILES
result: Dict[str, Dict] = {}
cwd_path = Path(os.getcwd())
for file in files:
for file in files + _DEFAULT_PARTIAL_FILES:
partials_file = cwd_path / file
if os.path.exists(partials_file):
with open(partials_file) as f:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ env_vars: {
}

{% if 'partials' in metadata
and 'integration' in metadata['partials'] -%}
{{ metadata['partials']['integration'] }}
and 'integration_append' in metadata['partials'] -%}
{{ metadata['partials']['integration_append'] }}
{%- endif -%}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ env_vars: {
}

{% if 'partials' in metadata
and 'integration' in metadata['partials'] -%}
{{ metadata['partials']['integration'] }}
and 'integration_append' in metadata['partials'] -%}
{{ metadata['partials']['integration_append'] }}
{%- endif -%}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ env_vars: {
}

{% if 'partials' in metadata
and 'integration' in metadata['partials'] -%}
{{ metadata['partials']['integration'] }}
and 'integration_append' in metadata['partials'] -%}
{{ metadata['partials']['integration_append'] }}
{%- endif -%}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
integration: |
integration_append: |
env_vars: {
key: "INTEGRATION_TEST_ARGS"
value: "-P bigtable-emulator-it"
Expand Down

0 comments on commit 7c32834

Please sign in to comment.