jamie
03/21/2023, 1:50 PM@asset(
partitions_def=DailyPartitionsDefinition(start_date="2023-01-01"),
ins={
"self_dependent_asset": AssetIn(
key=AssetKey(["self_dependent_asset"]),
partition_mapping=TimeWindowPartitionMapping(start_offset=-1, end_offset=-1),
),
},
metadata={
"partition_expr": "date",
},
)
def self_dependent_asset(context, self_dependent_asset: pd.DataFrame) -> pd.DataFrame:
date = pd.Timestamp(context.asset_partition_key_for_output())
if self_dependent_asset.empty:
return pd.DataFrame({"date": [date], "value": [1]})
return pd.DataFrame({"date": [date], "value": [self_dependent_asset["value"][0] + 1]})
This release also includes a bugfix. In a previous release, we updated the Snowflake I/O manager to create schemas if they did not exist. However, for accounts with restricted permissions, this would cause the I/O manager to error. The Snowflake I/O manager will still attempt to create a schema if it does not exist, but we’ve updated how we check if a schema exists so that accounts with restricted permissions do not error.