Skip to content
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 get client in flyte-cli commands #1063

Merged
merged 2 commits into from
Jun 14, 2022
Merged

Conversation

eapolinario
Copy link
Collaborator

Signed-off-by: Eduardo Apolinario [email protected]

TL;DR

Fix copy of dataclass in get_client in flyte-cli commands

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

Used dataclasses.replace to generate a copy of the PlatformConfig instead of the with_parameters.

Tracking Issue

flyteorg/flyte#2614

Follow-up issue

NA
OR
https://github.com/flyteorg/flyte/issues/

@codecov
Copy link

codecov bot commented Jun 14, 2022

Codecov Report

Attention: Patch coverage is 95.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 86.51%. Comparing base (7558e91) to head (ed68f45).
Report is 1058 commits behind head on master.

Files Patch % Lines
tests/flytekit/unit/cli/pyflyte/test_main.py 94.44% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1063   +/-   ##
=======================================
  Coverage   86.50%   86.51%           
=======================================
  Files         267      268    +1     
  Lines       24847    24864   +17     
  Branches     2797     2799    +2     
=======================================
+ Hits        21493    21510   +17     
  Misses       2877     2877           
  Partials      477      477           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -276,7 +277,7 @@ def _get_client(host: str, insecure: bool) -> _friendly_client.SynchronousFlyteC
if parent_ctx.obj["cacert"]:
kwargs["root_certificates"] = parent_ctx.obj["cacert"]
cfg = parent_ctx.obj["config"]
cfg = cfg.with_parameters(endpoint=host, insecure=insecure)
cfg = replace(cfg, endpoint=host, insecure=insecure)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL

@eapolinario eapolinario merged commit 14b3a4c into master Jun 14, 2022
eapolinario added a commit that referenced this pull request Jun 17, 2022
* Replace fields of platform_config with dataclasses.replace in flyte-cli/main.py

Signed-off-by: Eduardo Apolinario <[email protected]>

* Remove with_parameters

Signed-off-by: Eduardo Apolinario <[email protected]>

Co-authored-by: Eduardo Apolinario <[email protected]>
@eapolinario eapolinario mentioned this pull request Jun 17, 2022
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants