Replies: 2 comments 3 replies
-
I think this is a bug in dagster-duckdb-polars. Thus said, i really don't think that your solution is how it should be. @frostming any chance to get a
conditional dependencies? Or is there already a trick i am not aware of? |
Beta Was this translation helpful? Give feedback.
-
Hello 👋🏼 I think this not something that can be fixed by This case is a complex one as Python PEP508 doesn't handle CPU features at all. Anyway, I think it's worth the try: given [project]
dependencies = [
"polars==0.20.6",
"dagster-duckdb-polars",
]
[project.optional-dependencies]
prodserver = ["polars-lts-cpu==0.20.6"] So when installing IMHO, the proper solution for polars would be:
It can be something basic like: try:
import polars_lts_cpu.feature as feature
except ImportError:
import polars.feature as feature Note I believe it's even possible to use This way, package depending on Edit: I cross-posted my proposal in their issue. Who knows, maybe they'll use it |
Beta Was this translation helpful? Give feedback.
-
We are polars instead of pandas for managing dataframes. Our production server has an older processor that the polars package doesn't support. We have to use polars-lts-cpu. Both package are imported the same way in code... import polars.
So when we deploy and install dependencies in production, I setuped my .toml like so, made two optional groups and polars and polars-lts-cpu are not listed in the main dependencies:
When deploying in production I simply install the optional group prodserver. This way only polars-lts-cpu is installed and not polars.
Here is my problem though, I have one package in my dependencies called dagster-duckdb-polars and this one has a dependency on polars if I look at the lock file.
So now even though I don't specify polars in my [dependencies], it gets installed anyway because dagster-duckdb-polars has a dependency on it.
Any way for me to prevent that?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions