Skip to content

Fix WeaviateIngestOperator input_data validation before rendering#70326

Merged
shahar1 merged 3 commits into
apache:mainfrom
MannXo:fix/weaviate-ingest-template-field-init
Jul 24, 2026
Merged

Fix WeaviateIngestOperator input_data validation before rendering#70326
shahar1 merged 3 commits into
apache:mainfrom
MannXo:fix/weaviate-ingest-template-field-init

Conversation

@MannXo

@MannXo MannXo commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Move the input_data is None required-value check from __init__ into execute().

input_data is a template field, so it is rendered after the constructor runs. Validating it in __init__ checks the un-rendered value. Running the check in execute() validates the value the task actually uses.

Small behavior change: constructing the operator with input_data=None no longer raises immediately; the TypeError is raised when the task runs, after templating.

Part of the template-field constructor burn-down; removes the WeaviateIngestOperator entry from scripts/ci/prek/validate_operators_init_exemptions.txt in the same PR, as the hook requires.

related: #70296


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.8)

Generated-by: Claude Code (Opus 4.8) following the guidelines

input_data is a template field, rendered after __init__ runs. Validating
it in the constructor checks the un-rendered value. Move the required-value
check into execute() so it runs on the rendered value. Constructing with
input_data=None now raises at run time rather than at build time.
Comment thread providers/weaviate/src/airflow/providers/weaviate/operators/weaviate.py Outdated
The default was left over from the removed input_json alternative. Dropping it
restores parse-time validation of a missing input_data through Python itself and
lets mypy catch input_data=None, while the execute() check still guards values
that render to None after templating.
@shahar1
shahar1 dismissed their stale review July 24, 2026 14:42

Concerns addressed

@shahar1
shahar1 merged commit b6f72cd into apache:main Jul 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants