Skip to content

Commit

Permalink
fix(python): Align dependency versions (#9661)
Browse files Browse the repository at this point in the history
  • Loading branch information
zundertj authored Jul 1, 2023
1 parent 5c76bbf commit 7b32d82
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions py-polars/polars/dataframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -3167,12 +3167,12 @@ def write_database(
"'sqlalchemy' not found. Install polars with 'pip install polars[sqlalchemy]'."
) from exc

engine = create_engine(connection_uri)
engine_sa = create_engine(connection_uri)

# this conversion to pandas as zero-copy
# so we can utilize their sql utils for free
self.to_pandas(use_pyarrow_extension_array=True).to_sql(
name=table_name, con=engine, if_exists=if_exists, index=False
name=table_name, con=engine_sa, if_exists=if_exists, index=False
)

else:
Expand Down
9 changes: 6 additions & 3 deletions py-polars/polars/utils/show_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,16 @@ def show_versions() -> None:
def _get_dependency_info() -> dict[str, str]:
# see the list of dependencies in pyproject.toml
opt_deps = [
"numpy",
"pandas",
"pyarrow",
"adbc_driver_sqlite",
"connectorx",
"deltalake",
"fsspec",
"matplotlib",
"numpy",
"pandas",
"pyarrow",
"pydantic",
"sqlalchemy",
"xlsx2csv",
"xlsxwriter",
]
Expand Down
8 changes: 5 additions & 3 deletions py-polars/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,22 @@ Repository = "https://github.com/pola-rs/polars"
Changelog = "https://github.com/pola-rs/polars/releases"

[project.optional-dependencies]
# NOTE: keep this list in sync with show_versions()
# NOTE: keep this list in sync with show_versions() and requirements-dev.txt
pyarrow = ["pyarrow>=7.0.0"]
pandas = ["pyarrow>=7.0.0", "pandas"]
numpy = ["numpy >= 1.16.0"]
fsspec = ["fsspec"]
connectorx = ["connectorx"]
xlsx2csv = ["xlsx2csv >= 0.8.0"]
deltalake = ["deltalake >= 0.8.0"]
deltalake = ["deltalake >= 0.10.0"]
timezone = ["backports.zoneinfo; python_version < '3.9'", "tzdata; platform_system == 'Windows'"]
matplotlib = ["matplotlib"]
pydantic = ["pydantic"]
sqlalchemy = ["sqlalchemy", "pandas"]
xlsxwriter = ["xlsxwriter"]
adbc = ["adbc_driver_sqlite"]
all = [
"polars[pyarrow,pandas,numpy,fsspec,connectorx,xlsx2csv,deltalake,timezone,matplotlib,sqlalchemy,xlsxwriter]",
"polars[pyarrow,pandas,numpy,fsspec,connectorx,xlsx2csv,deltalake,timezone,matplotlib,pydantic,sqlalchemy,xlsxwriter,adbc]",
]

[tool.mypy]
Expand Down

0 comments on commit 7b32d82

Please sign in to comment.