Skip to content

Fix #609: Apply operator fails on semantic execution#610

Merged
mla2001 merged 2 commits intomainfrom
cr-609
Mar 19, 2026
Merged

Fix #609: Apply operator fails on semantic execution#610
mla2001 merged 2 commits intomainfrom
cr-609

Conversation

@mla2001
Copy link
Copy Markdown
Contributor

@mla2001 mla2001 commented Mar 19, 2026

Summary

Apply validate now handle BinOps like the evaluate method.

Checklist

  • Code quality checks pass (ruff format, ruff check, mypy)
  • Tests pass (pytest)
  • Documentation updated (if applicable)

@mla2001 mla2001 self-assigned this Mar 19, 2026
@mla2001 mla2001 requested review from a team and javihern98 March 19, 2026 12:35
@mla2001 mla2001 linked an issue Mar 19, 2026 that may be closed by this pull request
2 tasks
@mla2001 mla2001 changed the title Fix #609 Fix #609: Apply operator of the join fails on semantic execution Mar 19, 2026
@mla2001 mla2001 changed the title Fix #609: Apply operator of the join fails on semantic execution Fix #609: Apply operator fails on semantic execution Mar 19, 2026
Copy link
Copy Markdown
Contributor

@javihern98 javihern98 left a comment

Choose a reason for hiding this comment

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

Looks good, thanks! 😊

@mla2001 mla2001 merged commit 92bbf7e into main Mar 19, 2026
20 checks passed
mla2001 added a commit that referenced this pull request Mar 20, 2026
* Fixed literal casting inside sub operator (#538)

* Added visitScalarWithCast statement into sub AST constructor to handle ScalarWithCastContext

* Added related test

* Fix #541: Harden DuckDB error handling and detect infinite values (#542)

* Added visitScalarWithCast statement into sub AST constructor to handle ScalarWithCastContext

* Added related test

* Harden DuckDB error handling and detect infinite values (#541)

- Add pyarrow-based inf detection for ratio_to_report (division by zero)
- Add ieee_floating_point_ops=false to eval operator connection
- Add inf check on eval operator measure columns
- Replace bare exceptions in eval with dedicated error codes
- Add centralized error messages: 2-1-1-1, 2-1-3-1, 2-3-8, 1-1-1-21, 1-1-1-22
- Add test for ratio_to_report on zero-sum partitions

* Remove unrelated changes from issue #537

---------

Co-authored-by: Mateo <mateo.delorenzo@meaningfuldata.eu>

* Fixed julian SQL method failing with Date input (#547)

* Eval operator now cast Date columns to date64[pyarrow]

* Added related test

* Minor fix

* Refactor Eval operator to normalize date columns and improve readability

* Fixed ruff errors

* Fixed mypy errors

* Added "legacy" time period representation (#545)

* Added legacy representation method to TimePeriodHandler class

* Added legacy time period representation formatter

* Added related tests

* Renamed format_time_period_external_representation dataset argument to operand.

* Added related error message

* Updated invalid TimePeriodRepresentation exception

* Updated docs

* Updated docs

* updated sdmx reporting D regex

* Added related tests

* Updated docs

* Fix #544: Add Extra Inputs documentation page (#548)

* Add Extra Inputs documentation page for Value Domains and External Routines (#544)

* Improve extra_inputs docs and fix deploy job skip on release

- Add Time format example in Value Domains supported types
- Add SQL file example in External Routines
- Add note that only SQL external routines are supported
- Fix function names: validate_value_domain, validate_external_routine
- Fix deploy job being skipped when check-docs-label is skipped

* Remove broken .sql file support for external routines

The directory loading path filtered for .sql files but the file handler
only accepted .json, causing all .sql loads to fail. Removed the dead
.sql code path and updated docs to reflect JSON-only file support.

* Fix external_routines docstrings and type signature

Update run() and run_sdmx() docstrings from "String or Path" to
"Dict or Path" to match semantic_analysis() and value_domains. Remove
dead str type from load_external_routines() signature since strings
are rejected at runtime.

* Add automated tests for documentation Python examples

- Extract and execute Python code blocks from RST files (walkthrough.rst, extra_inputs.rst)
- Validate run results against reference CSV files using pyarrow dtype comparison
- Fix pre-existing bugs in walkthrough examples: wrong path casing (Docs/ → docs/),
  language "sqlite" → "SQL", Me_1 → Id_2 in VD membership, variable name typo,
  malformed value_domains dict, wrong VD/routine names in Example_6.vtl
- Update reference CSVs (Example_5.csv, Example_6_output.csv) to match corrected examples

* Fix incorrect parameter name in S3 example

Rename `output` to `output_folder` in environment_variables.rst to match the actual run() API signature.

* Fix Python 3.9 compatibility in doc example tests

Replace `str | None` (PEP 604, requires 3.10+) with `Optional[str]` to support Python 3.9.

* Fix Windows encoding error in RST code extractor

Specify UTF-8 encoding in read_text() to avoid charmap codec errors on Windows.

* Bump version to 1.6.0rc2 (#549)

* Bump version to 1.6.0rc2

* Update AI coding assistant instructions with version bump branch naming convention

* (QA 1.6.0) Updated legacy Time_Period month representation (#551)

* Added legacy representation method to TimePeriodHandler class

* Added legacy time period representation formatter

* Added related tests

* Renamed format_time_period_external_representation dataset argument to operand.

* Added related error message

* Updated invalid TimePeriodRepresentation exception

* Updated docs

* Updated docs

* updated sdmx reporting D regex

* Added related tests

* Updated docs

* Updated legacy Time_Period month repr from YYYY-Mdd to YYYY-MM

* Updated related tests

* Updated docs

* Bump ruff from 0.15.2 to 0.15.4 (#553)

Bumps [ruff](https://github.com/astral-sh/ruff) from 0.15.2 to 0.15.4.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@0.15.2...0.15.4)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.15.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fixed Analytic and Aggregate SQL queries fails with Date inputs (#552)

* Add date normalization method to Analytic class

* Add Date type handling in Aggregation class

* Added VTL error handling for duckdb query in Analytic class

* Minor fix

* Fixed linting errors

* Added Aggregate related tests

* Added Analytic related tests

* Enhanced error handling in Analytic class for duckdb query conversion issues

* Updated Analytic TimePeriod Handler

* Fixed ruff errors

* Added RANGE test

* Added Time_Period test

* Removed Time handler until review

* Fixed ruff errors

* Remove Time Period handler

* Bump version to 1.6.0rc3 (#556)

* Rename "legacy" time period representation to "natural" (#561)

* Added new exceptions to Analytic and Aggregate operators with String, Duration, TimePeriod, and TimeInterval (#558)

* Add semantic error handling for TimeInterval in Analytic and Aggregate operations

* Added related tests

* Added missing RunTimeError with TimePeriods with different durations test

* Enhance TimePeriod handling in Aggregation and Analytic operations with improved regex extraction and error handling

* Updated related tests

* Fixed related ests

* Fixed grammar test

* Fixed linting errors

* Minor fix

* Fix #557: Add custom release creation workflow based on issue types (#559)

* Bump version to 1.6.0rc4 (#563)

* Fix #555: Align grammar with standard VTL 2.1 (#564)

* Updated VTL Grammar

* Uodated lexer and parser

* Fixed related tests

* Grammar updated to the official VTL grammar

* Lexer and Parser regenerated

* Refactor comment handling in generate_ast_comment to use rstrip for newline removal

* Refactor time-related parsing in Expr and ExprComp

* Refactor constant handling in Terminals

* Fixed ruff errors

* Fixed mypy errors

* Trigger publish and docs workflows via repository_dispatch

* Fix #575: Allow swap renames in rename clause (#576)

The rename validation now excludes components being renamed away when
checking for name conflicts, and builds result components atomically
instead of sequentially to handle swaps correctly.

* Validate that data_structures does not contain extra datasets not referenced by the script (#569) (#570)

* Fix #574: Accept "" values as null on non String input cols and auto-detect other separators usage on input CSVs (#577)

* Updated parser logic

* Added related tests

* Simplified delimiter detection logic

* Fixed ruff errors

* Fixed mypy errora

* Fixed linting errors

* Minor fix

* Test commit sign

* Remove commit sign

* Bump version to 1.6.0rc5 (#580)

* Fix #578: Duration scalar-scalar comparison uses magnitude order (#579)

* Fix #578: Duration scalar-scalar comparison uses magnitude order instead of alphabetical

Apply PERIOD_IND_MAPPING conversion in scalar_evaluation before comparing
Duration values, consistent with all other evaluation paths. Also replace
raw Exception with .get() returning None for invalid durations.

* Add duration scalar comparison tests in additional scalars

Cover all six comparison operators (=, <>, <, >, <=, >=) with Duration
cast values to verify magnitude-based ordering.

* Add dataset, component-scalar, and component-component duration comparison tests

Cover all Duration comparison evaluation paths: scalar-scalar, dataset-dataset,
dataset-scalar, component-scalar, and component-component.

* Add TimePeriod comparison tests across all evaluation paths

Cover scalar-scalar, dataset-dataset, dataset-scalar, component-scalar,
and component-component comparisons for TimePeriod type.

* Handle non-PR numbers in create release workflow GraphQL query

Commit messages may reference issue numbers (e.g. (#569)) which cause
the pullRequest GraphQL query to fail with NOT_FOUND. Catch partial
errors and use the valid data instead of failing the entire workflow.

* Bump ruff from 0.15.4 to 0.15.5 (#583)

Bumps [ruff](https://github.com/astral-sh/ruff) from 0.15.4 to 0.15.5.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@0.15.4...0.15.5)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.15.5
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add run-name to publish workflows to show release version (#581)

* Fix 567: Update DAG Analysis sorting on Hierarchical Rulesets (#572)

* Removed Hierarchy AST rules validation and sorting from interpreter

* Updated DAG to validate and sort Hierarchical roll-up rules

* Added related tests

* Updated related test

* Minor fix

* Fixed mypy errors

* Removed outdated  pysapark code

* Added HRuleset rule sorting statement into DAGAnalyzer

* Fixed related assertion tests

* Updated cyclic graph detection

* Fixed related tests

* Added duplicated HR EQ rules error

* Updated related tests

* Fixed linting errors

* Fixed related tests

* Fix #582: Fixed time_agg grammar with single string constant in group_all and windowing (#584)

* Grammar aligned with the official VTL 2.1

* Regenerated Lexer, Parser and VTLVisitor

* Fixed related tests

* Fixed mypy errors

* Fix #585: Remove extra datasets validation (#586)

* Bump version to 1.6.0rc6 (#587)

* Bump version to 1.6.0 (#592)

* Exclude PRs with workflows label from release notes (#593)

* Update GitHub Actions to latest versions for Node.js 24 compatibility (#595)

* Bump ruff from 0.15.5 to 0.15.6 (#602)

Bumps [ruff](https://github.com/astral-sh/ruff) from 0.15.5 to 0.15.6.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@0.15.5...0.15.6)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.15.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix #596: Fix empty-only-comments AST generation (#597)

* Fixed empty/only-comments AST generation

* Added related tests

* Fix #598: Allow boolean constants in errorlevel and errorcode (#599)

* Fixed empty/only-comments AST generation

* Added related tests

* Fixed errorlevel as boolean handling on ASTString

* Fixed linting errors

* Added related tests

* Fixed mypy errors

* Minor fix

* Fix #565: Review Time_Agg in group by / group except (#591)

* Implemented new time_agg in group_by/except functionality

* Added related tests

* Added more tests

* Bump version to 1.6.1rc1 (#600)

Co-authored-by: Francisco Javier Hernández del Caño <javier.hernandez@meaningfuldata.eu>

* Fix #609: Apply operator fails on semantic execution (#610)

* Fixed apply validation method fails on semantic execution

* Added related test

* Fix #611: Setdiff operator return matching values whit nulls (#612)

* Fixed SetDiff operator taking rows with pre-existing null values as results

* Fixed related test references

* Added related test

* Add psutil dependency and mypy exclude for DuckDB transpiler

* Add DuckDB transpiler package from duckdb/main

* Add use_duckdb parameter and _run_with_duckdb to API

* Add DuckDB transpiler tests and backend support in test helper

Copy tests/duckdb_transpiler/ from duckdb/main, add VTL_ENGINE_BACKEND
env-var toggle (default: pandas) to TestHelper.BaseTest, and append
DuckDB SDMX loading tests to tests/API/test_sdmx.py.

* Remove s3fs dependency while keeping S3 URI support via httpfs

* Fix Helper.py ordering: load outputs after create_ast to preserve cycle detection

* Route DataLoadTest/DataLoadExceptionTest through DuckDB and add TimePeriod integration tests

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Mateo de Lorenzo Argelés <160473799+mla2001@users.noreply.github.com>
Co-authored-by: Mateo <mateo.delorenzo@meaningfuldata.eu>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@javihern98 javihern98 deleted the cr-609 branch March 23, 2026 10:43
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.

Apply operator fails on semantic execution

2 participants