Skip to content

Commit 54f0667

Browse files
chore: registry hygiene pass — clear all 34 shadow warnings, fix 33 example.yaml validation errors
L1 validation harness scorecard: PASS: 487 → 562 (+75) WARN: 33 → 0 (−33) FAIL: 74 → 41 (−33) Changes — shadow-attr warnings (34 components): All components with `model:` or `schema:` fields shadowing the Pydantic / Dagster Resolvable / Model parent class attributes were renamed to `model_id` / `schema_name` with `Field(alias="<orig>")` + `model_config = ConfigDict(populate_by_name=True)`. YAML-facing field name unchanged — existing example.yaml + customer defs.yaml keep working without any rewrite. Pattern applied (33 model rename + 4 schema rename) via the new tools/fix_shadow_warnings.py script, which reads the L1 validation report and applies the transform with sanity-checks (alias presence, ConfigDict import, body multiline-preserving rewrite). Changes — example.yaml validation errors (33 components fixed of 74): - 9 components had `source_asset:` in example.yaml but the component expected `upstream_asset_key:`. Renamed in-place. - 26 components were entirely missing `upstream_asset_key:` from example.yaml; added with descriptive per-component placeholders (raw_documents, raw_text, raw_tickets, rows_to_index, etc.). - 4 components used `*_asset` field names (google_ads_asset, facebook_ads_asset, campaign_data_asset, etc.) instead of the component's actual `*_asset_key` field. Renamed. - 4 IO managers (postgres / databricks / redshift / trino) used `schema_name:` in example.yaml but the component field is `default_schema:`. Renamed. - 5 source / sink components had skeleton example.yamls ("See schema.json for full attribute reference") — fleshed out with all required fields (cloudwatch_logs_insights_query, cloudwatch_metrics_query, dataframe_to_otlp_logs / _metrics / _traces). - 3 example.yamls had a misplaced `database_url_env_var:` line from a stub template — removed. Remaining 41 FAILs are diverse one-off issues (missing endpoint / client_id / api_token_env_var fields; deps wrong-type; renamed fields like source_table → table_name). These need per-component attention and will be addressed in a follow-up pass. New tool: tools/fix_shadow_warnings.py — batch-applies the alias-rename pattern from the L1 report. Reusable for future shadow warnings introduced by Pydantic / Dagster Resolvable API additions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b282938 commit 54f0667

88 files changed

Lines changed: 632 additions & 663 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

assets/ai/anthropic_llm/component.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
Output,
2626
MetadataValue,
2727
)
28-
from pydantic import Field
28+
from pydantic import ConfigDict, Field
2929

3030

3131
def _build_partitions_def(
@@ -169,6 +169,7 @@ class AnthropicLLMComponent(Component, Model, Resolvable):
169169
```
170170
"""
171171

172+
model_config = ConfigDict(populate_by_name=True)
172173
asset_name: str = Field(
173174
description="Name of the asset that will hold the enriched data"
174175
)
@@ -177,7 +178,8 @@ class AnthropicLLMComponent(Component, Model, Resolvable):
177178
description="Anthropic API key. Use ${ANTHROPIC_API_KEY} for environment variables."
178179
)
179180

180-
model: str = Field(
181+
model_id: str = Field(
182+
alias="model",
181183
default="claude-3-5-sonnet-20241022",
182184
description="Claude model: claude-3-5-sonnet-20241022, claude-3-opus-20240229, claude-3-sonnet-20240229, claude-3-haiku-20240307"
183185
)
@@ -393,7 +395,7 @@ class AnthropicLLMComponent(Component, Model, Resolvable):
393395
def build_defs(self, context: ComponentLoadContext) -> Definitions:
394396
asset_name = self.asset_name
395397
api_key = self.api_key
396-
model = self.model
398+
model = self.model_id
397399
system_prompt = self.system_prompt
398400
user_prompt_template = self.user_prompt_template
399401
input_column = self.input_column

assets/ai/anthropic_llm/example.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
type: dagster_component_templates.AnthropicLLMComponent
22
attributes:
33
asset_name: document_analysis
4+
upstream_asset_key: raw_documents
45

56
# Anthropic Configuration
67
api_key: "${ANTHROPIC_API_KEY}"

assets/ai/bank_statement_extractor/component.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
Resolvable,
1919
asset,
2020
)
21-
from pydantic import Field
21+
from pydantic import ConfigDict, Field
2222

2323

2424
def _build_partitions_def(
@@ -143,6 +143,7 @@ class BankStatementExtractorComponent(Component, Model, Resolvable):
143143
- Lending underwriting pipelines
144144
"""
145145

146+
model_config = ConfigDict(populate_by_name=True)
146147
asset_name: str = Field(description="Output Dagster asset name")
147148
upstream_asset_key: str = Field(
148149
description="Upstream asset key providing a DataFrame with bank statement content"
@@ -155,7 +156,9 @@ class BankStatementExtractorComponent(Component, Model, Resolvable):
155156
default="text",
156157
description="Input type: 'text' (raw text) or 'file' (read file content)",
157158
)
158-
model: str = Field(default="gpt-4o-mini", description="LiteLLM model string")
159+
model_id: str = Field(
160+
alias="model",
161+
default="gpt-4o-mini", description="LiteLLM model string")
159162
api_key_env_var: str = Field(
160163
default="OPENAI_API_KEY",
161164
description="Env var name for API key",
@@ -299,7 +302,7 @@ def build_defs(self, load_context: ComponentLoadContext) -> Definitions:
299302
upstream_asset_key = self.upstream_asset_key
300303
input_column = self.input_column
301304
input_type = self.input_type
302-
model = self.model
305+
model = self.model_id
303306
api_key_env_var = self.api_key_env_var
304307
output_fields = self.output_fields
305308
batch_size = self.batch_size

assets/ai/contract_extractor/component.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
Resolvable,
1919
asset,
2020
)
21-
from pydantic import Field
21+
from pydantic import ConfigDict, Field
2222

2323

2424
def _build_partitions_def(
@@ -143,6 +143,7 @@ class ContractExtractorComponent(Component, Model, Resolvable):
143143
- Vendor agreement analysis
144144
"""
145145

146+
model_config = ConfigDict(populate_by_name=True)
146147
asset_name: str = Field(description="Output Dagster asset name")
147148
upstream_asset_key: str = Field(
148149
description="Upstream asset key providing a DataFrame with contract content"
@@ -155,7 +156,9 @@ class ContractExtractorComponent(Component, Model, Resolvable):
155156
default="text",
156157
description="Input type: 'text' (raw text) or 'file' (read file content)",
157158
)
158-
model: str = Field(default="gpt-4o-mini", description="LiteLLM model string")
159+
model_id: str = Field(
160+
alias="model",
161+
default="gpt-4o-mini", description="LiteLLM model string")
159162
api_key_env_var: str = Field(
160163
default="OPENAI_API_KEY",
161164
description="Env var name for API key",
@@ -299,7 +302,7 @@ def build_defs(self, load_context: ComponentLoadContext) -> Definitions:
299302
upstream_asset_key = self.upstream_asset_key
300303
input_column = self.input_column
301304
input_type = self.input_type
302-
model = self.model
305+
model = self.model_id
303306
api_key_env_var = self.api_key_env_var
304307
output_fields = self.output_fields
305308
batch_size = self.batch_size

assets/ai/conversation_memory/example.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
type: dagster_component_templates.ConversationMemoryComponent
1313
attributes:
1414
asset_name: conversation
15+
upstream_asset_key: raw_messages
1516
memory_file: ./conversation.json
1617
max_messages: 10
1718
group_name: conversations

assets/ai/document_chunker/example.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
type: dagster_component_templates.DocumentChunkerComponent
22
attributes:
33
asset_name: document_chunks
4+
upstream_asset_key: raw_documents
45

56
# Chunking Strategy
67
strategy: "recursive" # fixed, recursive, sentence, token_aware, semantic

assets/ai/document_summarizer/component.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
Model,
2121
MetadataValue,
2222
)
23-
from pydantic import Field
23+
from pydantic import ConfigDict, Field
2424

2525

2626
def _build_partitions_def(
@@ -145,12 +145,15 @@ class DocumentSummarizerComponent(Component, Model, Resolvable):
145145
```
146146
"""
147147

148+
model_config = ConfigDict(populate_by_name=True)
148149
asset_name: str = Field(description="Name of the asset")
149150
upstream_asset_key: str = Field(description="Upstream asset key providing a DataFrame with documents to summarize")
150151
input_column: str = Field(default="text", description="Column name containing document text to summarize")
151152
output_column: str = Field(default="summary", description="Column name for generated summaries")
152153
provider: str = Field(description="LLM provider")
153-
model: str = Field(description="Model name")
154+
model_id: str = Field(
155+
alias="model",
156+
description="Model name")
154157
summary_type: str = Field(default="concise", description="Type: 'concise', 'detailed', 'bullet_points', 'executive'")
155158
max_length: Optional[int] = Field(default=None, description="Max summary length in words")
156159
chunk_size: int = Field(default=3000, description="Chunk size for long documents")
@@ -275,7 +278,7 @@ def build_defs(self, context: ComponentLoadContext) -> Definitions:
275278
input_column = self.input_column
276279
output_column = self.output_column
277280
provider = self.provider
278-
model = self.model
281+
model = self.model_id
279282
summary_type = self.summary_type
280283
max_length = self.max_length
281284
chunk_size = self.chunk_size

assets/ai/document_summarizer/example.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
type: dagster_component_templates.DocumentSummarizerComponent
55
attributes:
66
asset_name: report_summary
7+
upstream_asset_key: raw_documents
78
provider: openai
89
model: gpt-4
910
summary_type: executive

assets/ai/dspy_program/component.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
Resolvable,
1818
asset,
1919
)
20-
from pydantic import Field
20+
from pydantic import ConfigDict, Field
2121

2222

2323
def _build_partitions_def(
@@ -142,13 +142,16 @@ class DspyProgramComponent(Component, Model, Resolvable):
142142
```
143143
"""
144144

145+
model_config = ConfigDict(populate_by_name=True)
145146
asset_name: str = Field(description="Output Dagster asset name")
146147
upstream_asset_key: str = Field(description="Upstream asset key providing a DataFrame")
147148
text_column: str = Field(description="Column containing input text")
148149
output_column: str = Field(default="dspy_output", description="Primary output column (first output field)")
149150
program_type: str = Field(default="chain_of_thought", description="DSPy program type: predict, chain_of_thought, react, or multi_chain_comparison")
150151
signature: str = Field(description='DSPy signature string e.g. "question -> answer" or "document -> summary, key_points"')
151-
model: str = Field(default="gpt-4o-mini", description="LLM model string")
152+
model_id: str = Field(
153+
alias="model",
154+
default="gpt-4o-mini", description="LLM model string")
152155
api_key_env_var: Optional[str] = Field(default=None, description="Env var name for API key")
153156
group_name: Optional[str] = Field(default=None, description="Dagster asset group name")
154157
partition_type: Optional[str] = Field(
@@ -276,7 +279,7 @@ def build_defs(self, load_context: ComponentLoadContext) -> Definitions:
276279
output_column = self.output_column
277280
program_type = self.program_type
278281
signature = self.signature
279-
model = self.model
282+
model = self.model_id
280283
api_key_env_var = self.api_key_env_var
281284
group_name = self.group_name
282285

assets/ai/embeddings_generator/component.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
Output,
2323
MetadataValue,
2424
)
25-
from pydantic import Field
25+
from pydantic import ConfigDict, Field
2626

2727

2828
def _build_partitions_def(
@@ -163,6 +163,7 @@ class EmbeddingsGeneratorComponent(Component, Model, Resolvable):
163163
```
164164
"""
165165

166+
model_config = ConfigDict(populate_by_name=True)
166167
asset_name: str = Field(
167168
description="Name of the asset that will hold the embeddings"
168169
)
@@ -171,7 +172,8 @@ class EmbeddingsGeneratorComponent(Component, Model, Resolvable):
171172
description="Embedding provider: openai, cohere, sentence_transformers, huggingface"
172173
)
173174

174-
model: str = Field(
175+
model_id: str = Field(
176+
alias="model",
175177
description="Model name (e.g., 'text-embedding-3-small', 'embed-english-v3.0', 'all-MiniLM-L6-v2')"
176178
)
177179

@@ -361,7 +363,7 @@ class EmbeddingsGeneratorComponent(Component, Model, Resolvable):
361363
def build_defs(self, context: ComponentLoadContext) -> Definitions:
362364
asset_name = self.asset_name
363365
provider = self.provider
364-
model = self.model
366+
model = self.model_id
365367
api_key = self.api_key
366368
input_column = self.input_column
367369
output_column = self.output_column

0 commit comments

Comments
 (0)