-
Notifications
You must be signed in to change notification settings - Fork 258
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
Add a type transformer for whylogs dataset profiles #1023
Conversation
I've got several TODOs in the code where things need to change but this is a good first step. Next is to take a stab at the rendering plugin.
We published our rc to pypi so I can actually reference it directly without the wheel.
Thank you for opening this pull request! 🙌 These tips will help get your PR across the finish line:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1023 +/- ##
==========================================
+ Coverage 86.39% 86.49% +0.09%
==========================================
Files 255 265 +10
Lines 24417 24759 +342
Branches 2775 2445 -330
==========================================
+ Hits 21095 21415 +320
- Misses 2850 2870 +20
- Partials 472 474 +2 ☔ View full report in Codecov by Sentry. |
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.
minor comments we already talked about. let me know when the whylogs dependency is published and we're ready for final review.
@@ -4,7 +4,7 @@ | |||
|
|||
import flytekit | |||
from flytekit import kwtypes, task, workflow | |||
from flytekit.types.schema import FlyteSchema |
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.
Could we revert this? It's used below.
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.
I don't think this is required in the latest version. LMK if otherwise.
|
||
# TODO where is this visible from? | ||
# TODO how can I test this out locally? Do I need to build a wheel of flytekit and use it from a real project? | ||
def to_html(self, ctx: FlyteContext, python_val: DatasetProfileView, expected_python_type: Type[DatasetProfileView]) -> str: |
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.
@pingsutw - could you help please? sorry i still don't know what the right way to extend flyte deck is. is there documentation somewhere?
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.
We just need to convert python_val
to HTML string or pure string.
flytekit/flytekit/core/type_engine.py
Lines 139 to 143 in cc2a4e7
def to_html(self, ctx: FlyteContext, python_val: T, expected_python_type: Type[T]) -> str: | |
""" | |
Converts any python val (dataframe, int, float) to a html string, and it will be wrapped in the HTML div | |
""" | |
return str(python_val) |
python_val.to_pandas().to_html()
is correct.
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.
Ok. That's what I'll leave it as for now then. Our next update will be to use our actual html viewer to visualize the profiles. How can I see the render? Is it going to be a full page or a tiny window that pops up in a hover tooltip?
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.
When you run the workflow locally, flytekit will output a deck.html file in the local disk. just open it, and you are able to see the render.
Note: you have to set env var FLYTE_SDK_LOGGING_LEVEL to 20 to see the log.
you can follow this guide. https://flyte--735.org.readthedocs.build/projects/cookbook/en/735/auto/core/flyte_basics/deck.html
plugins/flytekit-whylogs/flytekitplugins/whylogs/transformer.py
Outdated
Show resolved
Hide resolved
Superseded by #1100. |
TL;DR
This adds a type plugin that enables whylog's dataset profiles to participate in the flytekit task framework.
Type
Are all requirements met?
Complete description
This is the first step to enabling whylogs dataset profile visualization in flytedeck and enabling constraints. Viz will be hooked up through flytedeck and it will allow users to visualize the data in that workflow. Constraints are a way to specify properties that should hold in the data and conditionally fail the workflow otherwise.
Tracking Issue
Follow-up issue
We're in the process of releasing our 1.0.0 right now and some features (constraints in particular) are missing from our release candidate. I need that to exist before I can add the right example. I'll also have to update the dependency in setup.py.