Skip to content

Commit ca149b2

Browse files
committed
Use common pandas version from core package
1 parent 8aad7d4 commit ca149b2

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

edgar/core.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929

3030
log = logging.getLogger(__name__)
3131

32+
pandas_version_raw = version.parse(pd.__version__)
33+
major, minor, patch = pandas_version_raw.major, pandas_version_raw.minor, pandas_version_raw.micro
34+
pandas_version = (major, minor, patch)
35+
3236
# sys version
3337
python_version = tuple(map(int, sys.version.split()[0].split('.')))
3438

@@ -67,6 +71,7 @@
6771
'YearAndQuarters',
6872
'quarters_in_year',
6973
'parallel_thread_map',
74+
'pandas_version'
7075
]
7176

7277
IntString = Union[str, int]

edgar/files/htmltools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from rich import box
1212
from rich.panel import Panel
1313
from rich.table import Table
14+
from edgar.core import pandas_version
1415

1516
from edgar.datatools import compress_dataframe
1617
from edgar.files.html_documents import HtmlDocument, Block, TableBlock, table_to_markdown
@@ -266,7 +267,6 @@ def chunks2df(chunks: List[List[Block]],
266267

267268
# Foward fill item and parts
268269
# Handle deprecation warning in fillna(method='ffill')
269-
pandas_version = tuple(map(int, pd.__version__.split('.')))
270270
if pandas_version >= (2, 1, 0):
271271
chunk_df.Item = chunk_df.Item.ffill().infer_objects(copy=False)
272272
else:

0 commit comments

Comments
 (0)