Hello, quick question. I am getting these deprecat...
# hamilton-help
a
Hello, quick question. I am getting these deprecation warnings since updating polars. But I don’t use polars in hamilton. Can I explicitly disable the polars hamilton plugin/extension?
Copy code
venv/lib/python3.11/site-packages/hamilton/plugins/polars_post_1_0_0_extension.py:597: DeprecationWarning: The `polars.type_aliases` module is deprecated. The type aliases have moved to the `polars._typing` module to explicitly mark them as private. Please define your own type aliases, or temporarily import from the `polars._typing` module. A public `polars.typing` module will be added in the future.
    from polars.type_aliases import ColumnTotalsDefinition, RowTotalsDefinition
Thanks.
t
Hi Arthur! Thanks for reporting this issue. Indeed, it seems that we overlooked 2 lines of code when moving to
polars >= 1.0.0
. Will create a fix this morning.
a
hopefully polars is more stable going forward. I get these every update on my code base But is there a way to explicitely disable the hamilton plugin?
t
There's currently no mechanism to disable extensions. In short, if you create a
Driver
extensions are imported. This is to resovle the graph in case you're using a dataframe library with
@extract_columns
for example. Hamilton automatically imports extensions based on the available packages in the current virtual environment. In other words,
polars_post_1_0_0_extension.py
is imported because you have
polars
installed Given I'll fix the current issue, are there other reasons you'd like to disable extension imports? We could create an environment variable for that purpose for instance
a
The only reason would be me being a bit pedantic. Given I don’t rely on these extensions (actually my dag doesn’t return any polars or pandas data frame, only arrow), I don’t want them enabled. But I’m sure in practice the over head is very minor. I just get notice it in the logs
Copy code
2024-07-17 07:01:30,477 - hamilton.registry - INFO - Detected polars and successfully loaded Hamilton extensions.
2024-07-17 07:01:30,210 - hamilton.registry - INFO - Detected pandas and successfully loaded Hamilton extensions.
s
@Arthur Andres how would you like to disable them from a UX perspective?
a
no as I mentioned it’s just me being pedantic. I don’t use it, therefore I wouldn’t like to see it. But it’s not causing any issue.
s
@Arthur Andres I can make the log statements DEBUG? 😛
a
If I really cared I’d change the level for that module. I think INFO makes sense.
👍 1