Skip to content

Test on all current Python versions #167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 19, 2025
Merged

Test on all current Python versions #167

merged 3 commits into from
May 19, 2025

Conversation

amc-corey-cox
Copy link
Contributor

Let's try to get ahead of things and run tests on the other Python versions to make sure we're still passing.

@amc-corey-cox amc-corey-cox requested a review from Copilot May 14, 2025 20:56
Copy link
Contributor

@Copilot 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 PR expands test coverage across newer Python versions, enhances data type inference for CSV inputs, and introduces slot range normalization in the RDFS importer.

  • Update GitHub Actions matrix to include Python 3.11–3.13 and switch to actions/cache@v3
  • Enhance infer_range to distinguish date vs datetime and add _normalize_slot_ranges in the RDFS importer
  • Migrate Poetry dev dependencies to the new group.dev format in pyproject.toml

Reviewed Changes

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

Show a summary per file
File Description
tests/test_importers/test_rdfs_importer.py Added pytest import and updated expected slot count/checks
tests/test_generalizers/test_csv_data_generalizer.py Added cases for date/datetime inference in infer_range tests
schema_automator/importers/rdfs_import_engine.py Extended type hints, logging warnings on duplicate slots, and added slot range normalization
schema_automator/generalizers/csv_data_generalizer.py Added date-only detection branch before datetime in infer_range
pyproject.toml Converted dev-dependencies section to [tool.poetry.group.dev.dependencies]
.github/workflows/check-pull-request.yaml Expanded matrix to Python 3.11–3.13, removed Windows, and allowed 3.13 to fail
Comments suppressed due to low confidence (2)

.github/workflows/check-pull-request.yaml:22

  • [nitpick] Since windows-latest has been removed from the matrix, the existing exclude block for Windows + 3.9 is now redundant; consider removing it to simplify the workflow.
exclude:

pyproject.toml:63

  • Verify that your Poetry version supports the new group.dev.dependencies table; older versions expect tool.poetry.dev-dependencies and may break CI.
[tool.poetry.group.dev.dependencies]

@@ -5,6 +5,7 @@
from io import StringIO
import unittest
import os
import pytest
Copy link
Preview

Copilot AI May 14, 2025

Choose a reason for hiding this comment

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

The pytest import is never used in this test file; consider removing the unused import.

Suggested change
import pytest

Copilot uses AI. Check for mistakes.

default_prefix: str | None = None,
model_uri: str | None = None,
identifier: str | None = None,
file: Union[str, Path, TextIO],
Copy link
Preview

Copilot AI May 14, 2025

Choose a reason for hiding this comment

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

The parameter name file shadows a common built-in; consider renaming it (e.g., source or input_path) for better clarity.

Suggested change
file: Union[str, Path, TextIO],
input_path: Union[str, Path, TextIO],

Copilot uses AI. Check for mistakes.

identifier: str | None = None,
file: Union[str, Path, TextIO],
name: Optional[str] = None,
format: Optional[str] = "turtle",
Copy link
Preview

Copilot AI May 14, 2025

Choose a reason for hiding this comment

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

The parameter name format shadows the built-in format function; consider renaming it (e.g., rdf_format) to avoid confusion.

Suggested change
format: Optional[str] = "turtle",
rdf_format: Optional[str] = "turtle",

Copilot uses AI. Check for mistakes.

Comment on lines 648 to 651
if all(
not hasattr(parse(str(v)), 'hour') or
(parse(str(v)).hour == 0 and parse(str(v)).minute == 0 and parse(str(v)).second == 0)
for v in nn_vals
Copy link
Preview

Copilot AI May 14, 2025

Choose a reason for hiding this comment

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

[nitpick] You call parse(str(v)) twice for each value in the date-only check; consider parsing once per value and reusing the result to eliminate redundant work.

Suggested change
if all(
not hasattr(parse(str(v)), 'hour') or
(parse(str(v)).hour == 0 and parse(str(v)).minute == 0 and parse(str(v)).second == 0)
for v in nn_vals
parsed_vals = [parse(str(v)) for v in nn_vals]
if all(
not hasattr(pv, 'hour') or
(pv.hour == 0 and pv.minute == 0 and pv.second == 0)
for pv in parsed_vals

Copilot uses AI. Check for mistakes.

@ptgolden ptgolden merged commit 806c9a1 into main May 19, 2025
6 checks passed
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.

2 participants