Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions examples/schema/dataflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ def df_with_renamed_cols(df_with_new_cols: pd.DataFrame) -> pd.DataFrame:
from hamilton import driver
from hamilton.plugins import h_schema

dr = (
driver.Builder()
.with_modules(__main__)
.with_adapters(h_schema.SchemaValidator("./schemas"))
.build()
)
validator_adapter = h_schema.SchemaValidator("./schemas")
dr = driver.Builder().with_modules(__main__).with_adapters(validator_adapter).build()
res = dr.execute(["df_with_renamed_cols"])
print(json.dumps(dr.adapter.adapters[0].json_schemas, indent=2))
print(json.dumps(validator_adapter.json_schemas, indent=2))
10 changes: 5 additions & 5 deletions examples/schema/multi_dataflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,18 @@ def pandas_new_col__v4(ibis_rename: ir.Table) -> pd.DataFrame:
"--no-check", action="store_false", help="Disable `check` to update the stored schemas."
)
args = parser.parse_args()

validator_adapter = h_schema.SchemaValidator(
"./multi_schemas", check=args.no_check, importance="warn"
)
dr = (
driver.Builder()
.with_modules(__main__)
.with_config(dict(version=args.version))
.with_adapters(
h_schema.SchemaValidator("./multi_schemas", check=args.no_check, importance="warn")
)
.with_adapters(validator_adapter)
.build()
)
res = dr.execute(["pandas_new_col"])
print(res["pandas_new_col"].head())
print()

print(json.dumps(dr.adapter.adapters[0].json_schemas, indent=2))
print(json.dumps(validator_adapter.json_schemas, indent=2))
2 changes: 1 addition & 1 deletion hamilton/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = (1, 66, 1)
VERSION = (1, 67, 0)