Skip to content

Commit bdf1846

Browse files
authored
Merge branch 'main' into 2026-03-02_agent
2 parents 14e0449 + ca50937 commit bdf1846

27 files changed

Lines changed: 9229 additions & 7773 deletions

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ updates:
1010
- "*"
1111
commit-message:
1212
prefix: ci
13+
cooldown:
14+
default-days: 7

.github/workflows/build.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,11 @@ jobs:
5757
environments: build
5858
- name: Set version
5959
run: pixi run -e build set-version
60-
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
61-
with:
62-
python-version: "3.10"
6360
- name: Build wheel
6461
uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad # v1.50.1
6562
with:
6663
command: build
67-
args: --out dist --release
64+
args: --out dist --release -i python3.10
6865
manylinux: auto
6966
sccache: true
7067
- name: Check package
@@ -84,7 +81,7 @@ jobs:
8481
id-token: write
8582
environment: pypi
8683
steps:
87-
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
84+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
8885
with:
8986
path: dist
9087
merge-multiple: true

.github/workflows/chore-main.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Chore
2+
on:
3+
push:
4+
branches: [main]
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
draft-release:
12+
name: Draft Release
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
pull-requests: read
17+
steps:
18+
- name: Update release draft
19+
uses: release-drafter/release-drafter@139054aeaa9adc52ab36ddf67437541f039b88e2 # v7.1.1
20+
with:
21+
token: ${{ github.token }}
Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ on:
33
pull_request_target:
44
branches: [main]
55
types: [opened, reopened, edited, synchronize]
6-
push:
7-
branches: [main]
86

97
concurrency:
108
group: ${{ github.workflow }}-${{ github.ref }}
@@ -13,7 +11,6 @@ concurrency:
1311
jobs:
1412
check-pr-title:
1513
name: Check PR Title
16-
if: github.event_name == 'pull_request_target'
1714
runs-on: ubuntu-latest
1815
permissions:
1916
contents: read
@@ -28,7 +25,7 @@ jobs:
2825
GITHUB_TOKEN: ${{ github.token }}
2926
- name: Post comment about invalid PR title
3027
if: failure()
31-
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
28+
uses: marocchino/sticky-pull-request-comment@70d2764d1a7d5d9560b100cbea0077fc8f633987 # v3.0.2
3229
with:
3330
header: conventional-commit-pr-title
3431
message: |
@@ -45,22 +42,18 @@ jobs:
4542
</details>
4643
- name: Delete comment about invalid PR title
4744
if: success()
48-
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
45+
uses: marocchino/sticky-pull-request-comment@70d2764d1a7d5d9560b100cbea0077fc8f633987 # v3.0.2
4946
with:
5047
header: conventional-commit-pr-title
5148
delete: true
5249

53-
release-drafter:
54-
name: ${{ github.event_name == 'pull_request_target' && 'Assign Labels' || 'Draft Release' }}
50+
assign-labels:
51+
name: Assign Labels
5552
runs-on: ubuntu-latest
5653
permissions:
57-
contents: write
5854
pull-requests: write
5955
steps:
60-
- name: ${{ github.event_name == 'pull_request_target' && 'Assign labels' || 'Update release draft' }}
61-
uses: release-drafter/release-drafter@6db134d15f3909ccc9eefd369f02bd1e9cffdf97 # v6.2.0
56+
- name: Assign labels
57+
uses: release-drafter/release-drafter/autolabeler@139054aeaa9adc52ab36ddf67437541f039b88e2 # v7.1.1
6258
with:
63-
disable-releaser: ${{ github.event_name == 'pull_request_target' }}
64-
disable-autolabeler: ${{ github.event_name == 'push' }}
65-
env:
66-
GITHUB_TOKEN: ${{ github.token }}
59+
token: ${{ github.token }}

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Install Rust
3131
run: rustup show
3232
- name: Cache Rust dependencies
33-
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
33+
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
3434
- name: pre-commit
3535
run: pixi run pre-commit-run --color=always --show-diff-on-failure
3636

@@ -71,7 +71,7 @@ jobs:
7171
- name: Install Rust
7272
run: rustup show
7373
- name: Cache Rust dependencies
74-
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
74+
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
7575
- name: Install repository
7676
run: pixi run -e ${{ matrix.environment }} postinstall
7777
- name: Run pytest

.github/workflows/copilot-setup-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ jobs:
2121
- name: Install Rust
2222
run: rustup show
2323
- name: Cache Rust dependencies
24-
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
24+
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
2525
- name: Install repository
2626
run: pixi run postinstall

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@ jobs:
7474
# Upload the results to GitHub's code scanning dashboard (optional).
7575
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
7676
- name: "Upload to code-scanning"
77-
uses: github/codeql-action/upload-sarif@89a39a4e59826350b863aa6b6252a07ad50cf83e # v3.29.5
77+
uses: github/codeql-action/upload-sarif@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
7878
with:
7979
sarif_file: results.sarif

dataframely/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
"deserialize_schema",
7979
"read_parquet_metadata_schema",
8080
"read_parquet_metadata_collection",
81+
"infer_schema",
8182
"Any",
8283
"Binary",
8384
"Bool",

dataframely/_base_schema.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
else:
2222
from typing_extensions import Self
2323

24-
2524
_COLUMN_ATTR = "__dataframely_columns__"
2625
_RULE_ATTR = "__dataframely_rules__"
2726

2827
ORIGINAL_COLUMN_PREFIX = "__DATAFRAMELY_ORIGINAL__"
2928

29+
3030
# --------------------------------------- UTILS -------------------------------------- #
3131

3232

@@ -84,6 +84,25 @@ class Metadata:
8484
rules: dict[str, RuleFactory] = field(default_factory=dict)
8585

8686
def update(self, other: Self) -> None:
87+
"""Merge another Metadata instance into this one.
88+
89+
Overlapping keys are allowed if and only if they refer to the *same* underlying
90+
object. This accommodates multiple-inheritance / diamond patterns where the same
91+
base schema is visited more than once.
92+
"""
93+
# Detect conflicting column definitions: same name, different Column instance
94+
duplicated_column_names = self.columns.keys() & other.columns.keys()
95+
conflicting_columns = {
96+
name
97+
for name in duplicated_column_names
98+
if self.columns[name] is not other.columns[name]
99+
}
100+
if conflicting_columns:
101+
raise ImplementationError(
102+
f"Columns {conflicting_columns} are duplicated with conflicting definitions."
103+
)
104+
105+
# All clear
87106
self.columns.update(other.columns)
88107
self.rules.update(other.rules)
89108

@@ -203,6 +222,8 @@ def _get_metadata(source: dict[str, Any]) -> Metadata:
203222
k: v for k, v in source.items() if not k.startswith("__")
204223
}.items():
205224
if isinstance(value, Column):
225+
if (col_name := value.alias or attr) in result.columns:
226+
raise ImplementationError(f"Column {col_name!r} is duplicated.")
206227
result.columns[value.alias or attr] = value
207228
if isinstance(value, RuleFactory):
208229
# We must ensure that custom rules do not clash with internal rules.

dataframely/_compat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ class Dialect: # type: ignore # noqa: N801
6363

6464
try:
6565
import pydantic
66-
except ImportError:
66+
except ImportError: # pragma: no cover
6767
pydantic = _DummyModule("pydantic") # type: ignore
6868

6969
try:
7070
from pydantic_core import core_schema as pydantic_core_schema
71-
except ImportError:
71+
except ImportError: # pragma: no cover
7272
pydantic_core_schema = _DummyModule("pydantic_core_schema") # type: ignore
7373

7474
# --------------------------------------- POLARS ------------------------------------- #

0 commit comments

Comments
 (0)