Skip to content

Commit 7c53945

Browse files
authored
Merge pull request #240 from kayjan/polars-fix
fix: polars error handling and python 3.7 support
2 parents 691940e + f50321c commit 7c53945

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Changed:
9+
- Misc: Remove support of Python 3.7 due to incompatibility with polars.
10+
### Fixed:
11+
- Tree Constructor and Exporter: Error handling when user only partially download optional dependencies of pandas/polars.
812

913
## [0.18.0] - 2024-05-28
1014
### Added:

bigtree/utils/assertions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def assert_dataframe_no_duplicate_attribute(
142142
id_col (str): column of data that is unique, can be name or path
143143
attribute_cols (List[str]): columns of data containing node attribute information,
144144
"""
145-
if isinstance(data, pd.DataFrame):
145+
if pd and isinstance(data, pd.DataFrame):
146146
data_check = data[[id_col] + attribute_cols].astype(str).drop_duplicates()
147147
duplicate_check = (
148148
data_check[id_col]
@@ -175,7 +175,7 @@ def assert_dataframe_no_duplicate_children(
175175
parent_col (str): column of data containing parent name information
176176
"""
177177
# Filter for child nodes that are parent of other nodes
178-
if isinstance(data, pd.DataFrame):
178+
if pd and isinstance(data, pd.DataFrame):
179179
data_check = data[[child_col, parent_col]].drop_duplicates()
180180
data_check = data_check[data_check[child_col].isin(data_check[parent_col])]
181181
duplicate_check = (

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
66
name = "bigtree"
77
description = "Tree Implementation and Methods for Python, integrated with list, dictionary, pandas and polars DataFrame."
88
readme = "README.md"
9-
requires-python = ">=3.7"
9+
requires-python = ">=3.8"
1010
license = {text = "MIT"}
1111
keywords = [
1212
"tree",
@@ -18,7 +18,6 @@ authors = [
1818
classifiers = [
1919
"Development Status :: 4 - Beta",
2020
"Programming Language :: Python",
21-
"Programming Language :: Python :: 3.7",
2221
"Programming Language :: Python :: 3.8",
2322
"Programming Language :: Python :: 3.9",
2423
"Programming Language :: Python :: 3.10",

0 commit comments

Comments
 (0)