Skip to content

Conversation

@DunklesArchipel
Copy link
Member

@DunklesArchipel DunklesArchipel commented Jan 28, 2026

Checklist

  • Added an entry in doc/news/.
  • Added a test for this change.
  • Adapted the documentation for this change.

@DunklesArchipel DunklesArchipel changed the title Refactor loading packages and include baseloader Refactor loading entries and include baseloader Jan 28, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request refactors the entry loading infrastructure by introducing new resource creation functions and incorporating the BaseLoader for handling CSV files with complex structures. The changes improve the API design by separating concerns between resource creation and package building, and enable support for CSV files with multiple header lines.

Changes:

  • Refactored CSV loading into separate functions for different resource types (tabular vs. pandas dataframe resources)
  • Extracted field updating logic into a standalone update_fields function
  • Modified Entry.from_df to work with in-memory pandas resources instead of temporary files
  • Added support for CSV files with custom encodings, delimiters, and multiple header lines
  • Updated pixi version from v0.50.2 to v0.63.2 across CI workflows

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
unitpackage/local.py Refactored resource creation functions, added create_tabular_resource_from_csv, create_df_resource_from_csv, create_df_resource_from_df, renamed create_df_resource to create_df_resource_from_tabular_resource, extracted update_fields function, updated create_unitpackage signature
unitpackage/entry.py Extended from_csv with encoding/delimiter parameters, refactored from_df to use pandas resources, updated mutable_resource property with format validation, modified save method to handle pandas-to-CSV conversion
unitpackage/loaders/baseloader.py Added documentation example for column_header_lines parameter
pixi.lock Updated pixi configuration, removed editable flag, added pypi-prerelease-mode option
examples/from_csv/from_csv_multiple_headers.csv Added test data file with multiple header lines
.github/workflows/*.yml Updated pixi version to v0.63.2 across all workflows

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 341 to 344
if len(unspecified_fields) != 0:
logger.warning(
f"Additional information were not provided for fields {unspecified_fields}."
)
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unspecified_fields list is initialized but never populated. This warning will never be triggered. If the intention is to track fields from the original schema that were not updated with information from the provided fields, the logic should populate this list in the else branch of the main loop (line 339).

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant