Skip to content

Commit

Permalink
run black
Browse files Browse the repository at this point in the history
  • Loading branch information
leahecole committed Dec 5, 2024
1 parent d672c61 commit f56d30f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 11 deletions.
8 changes: 6 additions & 2 deletions cloudcomposerdiff/src/cloudcomposerdiff/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,16 @@ def main(
) -> None:
"""The cloudcomposerdiff tool for comparing Cloud Composer environments."""

env1: service_v1.types.Environment = service_v1.EnvironmentsClient().get_environment(
env1: (
service_v1.types.Environment
) = service_v1.EnvironmentsClient().get_environment(
request=service_v1.GetEnvironmentRequest(
name=f"projects/{env1_project_id}/locations/{env1_location}/environments/{env1_name}"
)
)
env2: service_v1.types.Environment = service_v1.EnvironmentsClient().get_environment(
env2: (
service_v1.types.Environment
) = service_v1.EnvironmentsClient().get_environment(
request=service_v1.GetEnvironmentRequest(
name=f"projects/{env2_project_id}/locations/{env2_location}/environments/{env2_name}"
)
Expand Down
18 changes: 9 additions & 9 deletions cloudcomposerdiff/src/cloudcomposerdiff/lib/comparator.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ def output_diffs_as_json(self: T) -> None:
{
"category": diff.category_of_diff,
"attribute": diff.diff_anchor,
"env_1_value": None
if diff.values_match
else diff.env_1_anchor_value,
"env_2_value": None
if diff.values_match
else diff.env_2_anchor_value,
"matching_value": diff.env_1_anchor_value
if diff.values_match
else None,
"env_1_value": (
None if diff.values_match else diff.env_1_anchor_value
),
"env_2_value": (
None if diff.values_match else diff.env_2_anchor_value
),
"matching_value": (
diff.env_1_anchor_value if diff.values_match else None
),
}
)
json.dump(json_data, write_file, indent=4)
1 change: 1 addition & 0 deletions cloudcomposerdiff/tests/test_diff_airflow_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""

from typing import List

from google.cloud.orchestration.airflow import service_v1
Expand Down
1 change: 1 addition & 0 deletions cloudcomposerdiff/tests/test_diff_env_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""

from typing import List

from google.cloud.orchestration.airflow import service_v1
Expand Down
1 change: 1 addition & 0 deletions cloudcomposerdiff/tests/test_diff_env_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""

from typing import List

from google.cloud.orchestration.airflow import service_v1
Expand Down
1 change: 1 addition & 0 deletions cloudcomposerdiff/tests/test_diff_pypi_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""

from typing import List

from google.cloud.orchestration.airflow import service_v1
Expand Down

0 comments on commit f56d30f

Please sign in to comment.