Repository navigation
v0.2.2
[v0.2.2] - 2025-04-08
Added
-
inspect.pymodule with the following new functions:show_shape– returns the shape of a DataFrameshow_dupes– counts duplicated rowsshow_catvar– returns list of categorical (object/category) columnsshow_convar– returns list of continuous (non-categorical) columnsshow_lowcardvars– identifies categorical columns with low cardinalityshow_binary_list– identifies binary columns (with/without NaNs)count_rows_with_any_na– counts rows with at least one missing valuecount_rows_with_all_na– counts rows where all values are missingcount_cols_with_any_na– counts columns with at least one missing valuecount_cols_with_all_na– counts columns where all values are missingcount_total_na– returns the total number of missing valuescount_unique_values– returns unique value counts per column
(Docstrings included, generated by ChatGPT.)
-
Unit tests for all
eda_helpers.pyfunctions. -
Test fixtures:
create_na_test_df()andcreate_unique_test_df()intest_utils.py. -
test_s3.pyunit tests for theaws/s3module:list_s3_contentss3_file_to_dataframe
-
Shared test fixtures in
tests/conftest.pyfor mocking CSV/Excel downloads. -
Added automatic documentation via
mkdocs- Add
docs\folder mkdocs.ymlindex.mdandapi.md
- Add
-
eda/datetime.pymodule with datetime feature engineering functions:create_dt_col()– creates a single derived datetime column (e.g.,timestamp_year)create_dt_cols()– supports creation of multiple datetime-derived columns in one call- Supports:
"year","month","day","weekday","weekday_name","weekofyear","quarter","dayofyear","is_weekend","is_month_start","is_month_end" - Includes validation for unsupported types and missing columns
- Raises error if inconsistent datetime formats (e.g., mixed
"/"and"-") are detected
- Supports:
-
Unit tests for
eda/datetime.py:- Test coverage for both single and multi-column expansion
- Error handling for:
- Invalid column names
- Unsupported
col_types - Mixed datetime formats
- Auto-conversion of string-formatted dates
-
Refactored and consolidated test fixtures into
tests/conftest.py:- Moved all fixtures from
test_utils.pyintoconftest.pyfor automatic discovery across all test files - Includes fixtures:
sample_df,na_test_df,unique_test_df,binary_list_df,datetime_df,dummy_csv_bytes,dummy_excel_bytes,mock_requests_get
- Moved all fixtures from
-
New test module:
tests/unit/test_datetime.py- Organized tests specifically for datetime feature extraction utilities
-
New
dataiomodule withsave_parquet()andload_parquet()functions for reliable Parquet I/O -
Type-safe and documented with NumPy-style docstrings
-
Full test coverage using reusable
sample_dffixture fromconftest.py -
Unit test file
test_io_utils.pyto validate read/write functionality and nested directory creation -
save_csv()function todataiomodule: cleanly saves DataFrames to CSV with defaultindex=Falseand automatic directory creation -
load_csv()function todataiomodule:- Attempts to load a CSV file using multiple common encodings (e.g.
'utf-8','latin1','cp1252') - Provides a helpful raw byte preview if all decoding attempts fail
- Raises informative
ValueErrorfor failed loads to assist with debugging corrupted or misencoded files
- Attempts to load a CSV file using multiple common encodings (e.g.
-
Unit tests for both
save_csv()andload_csv()usingsample_dfandtmp_path- Includes fallback test simulating corrupted file behavior
-
read_s3()todataio.s3_io: loads public S3-hosted CSV or Excel files into a DataFrame with built-in error handling -
Unit tests for
read_s3():- CSV and Excel load success
- Handles unsupported file types (
ValueError) - Graceful fallback on request errors (returns
None)
-
test_s3_utils.pyto testlist_s3_bucket()fromaws.s3_utilswith mockedboto3.client
Changed
-
eda/__init__.pyupdated to expose alleda_helpersfunctions. -
list_unique_values()updated to handle both single column names and lists. -
test_utils.pysimplified — now only contains helper functions if needed (no more@pytest.fixture) -
Updated test files (
test_inspect.py,test_transform.py, etc.) to rely on auto-discovered fixtures viaconftest.py -
eda/__init__.pyupdated to expose newdatetimefunctions -
Renamed
io.pytoio_utils.pyand moved todataio/to avoid namespace conflict with Python's built-iniomodule -
Updated all related imports to reflect new structure
-
Renamed
s3_file_to_dataframe()➝read_s3()for consistency with other I/O functions -
Split S3-related code:
list_s3_bucket()remains inaws.s3_utilsread_s3()moved to newdataio/s3_io.py
Fixed
-
Corrected module import paths for internal packages (
from jcds.aws.s3 import ...). -
Configured
pytest.inito include the project root inPYTHONPATH. -
Added input validation to
create_dt_cols()to prevent datetime parsing issues with inconsistent formats
Notes
- Test discovery is working via
pytest, and all tests are passing. - Added
motoandrequeststoenvironment.ymlto support AWS and HTTP mocking.