-
Notifications
You must be signed in to change notification settings - Fork 300
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
Serialize directly to model classes #481
Conversation
Signed-off-by: wild-endeavor <[email protected]>
Signed-off-by: wild-endeavor <[email protected]>
Signed-off-by: wild-endeavor <[email protected]>
Signed-off-by: wild-endeavor <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #481 +/- ##
==========================================
- Coverage 84.59% 84.56% -0.04%
==========================================
Files 363 363
Lines 27200 27269 +69
Branches 2237 2247 +10
==========================================
+ Hits 23011 23061 +50
- Misses 3583 3605 +22
+ Partials 606 603 -3
Continue to review full report at Codecov.
|
Signed-off-by: wild-endeavor <[email protected]>
Signed-off-by: wild-endeavor <[email protected]>
Signed-off-by: wild-endeavor <[email protected]>
Signed-off-by: wild-endeavor <[email protected]>
Signed-off-by: wild-endeavor <[email protected]>
Signed-off-by: wild-endeavor <[email protected]>
Signed-off-by: wild-endeavor <[email protected]>
Signed-off-by: wild-endeavor <[email protected]>
Signed-off-by: wild-endeavor <[email protected]>
flytekit/clis/flyte_cli/main.py
Outdated
@@ -1818,6 +1818,7 @@ def _extract_and_register( | |||
|
|||
flyte_entities_list = _extract_files(project, domain, version, file_paths, patches) | |||
for id, flyte_entity in flyte_entities_list: | |||
_click.secho(f"Registering {id}", fg="green") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_click.secho(f"Registering {id}", fg="green") | |
_click.secho(f"Registering {id}", fg="yellow") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
green makes you feel that it was successful.
Ideally I would like this
Registering {name}..... [OK] | [FAILED]
this looks awesome |
Signed-off-by: wild-endeavor <[email protected]>
Signed-off-by: wild-endeavor <[email protected]>
Signed-off-by: wild-endeavor <[email protected]>
Signed-off-by: wild-endeavor <[email protected]>
TL;DR
Gets rid of the Sdk... classes in the
translator.py
module. This should be the last place flytekit is explicitly using the old classes.Previously the
translator
module converted from the new Python classes (PythonFunctionTask, PythonFunctionWorkflow, LaunchPlan) into theSdkXyz
classes, and then relied on theserialize()
call within each of those Sdk classes, invoked byserialize.py
to convert them into model objects. Nowtranslator
will go directly to the model, and the serialization step will just callto_flyte_idl()
Type
Are all requirements met?
Complete description
common
dependencies intranslator.py
and replace with the model classes.flytekit.models.task.TaskSpec
flytekit.models.launch_plan.LaunchPlan
flytekit.models.admin.WorkflowSpec
AuthRole
settings in the serialization step. These were being read in the property field forauth_role
in theSdkLaunchPlan
class itself.None
. That is, whenever a reference entity is run throughtranslator.py
, aNone
is returned and cached in the ordered dict. This is useful because the translator is used in one other place - in dynamic tasks. The runtime dynamic task compilation will look for theseNone
s and reject them. UsingNone
as a sentinel value is not good, but I think this PR has enough going on so will address that in a future PR.Tracking Issue
flyteorg/flyte#822
Follow-up issue
flyteorg/flyte#1044