The time spine configuration has been redesigned to support new features (sub-daily granularity and custom calendar - designs here). This PR adds the new configuration needed for sub-daily granularity and marks the old one as in the process of deprecation. Best reviewed by commit to isolate the NodeRelation changes.
Deprecated config: Currently, the TimeSpineTableConfiguration is automatically set for all users in the core parser. This assumes the user has set up a model called metricflow_time_spine at DAY granularity, so that configuration is set automatically in the manifest. This config was never exposed to users in YAML. The only logic change made here for the legacy config is to make it no longer required in the JSON schema, which will help with eventual migration. The plan is to continue setting the old config automatically in the manifest until users have migrated over to the new one, using validation warnings to prompt them to migrate. MetricFlow will support both fields in the meantime.
NodeRelation changes: I renamed the NodeRelation implementation class PydanticNodeRelation to match all other implementation classes - previously the protocol and implementation classes had the same name. This will not be a breaking change for core/mantle because this class is never imported directly there. I also needed to move those classes to their own files to avoid circular imports. Viewing that commit separately should be helpful for review - the commit is purely copy/paste, no logic changes.
New config: I've included an example of what the YAML spec has been designed to look like below. Note that the top level key (semantic-layer) and the model key will be implemented in core instead of here.
Resolves #280
Description
The time spine configuration has been redesigned to support new features (sub-daily granularity and custom calendar - designs here). This PR adds the new configuration needed for sub-daily granularity and marks the old one as in the process of deprecation. Best reviewed by commit to isolate the
NodeRelation
changes.TimeSpineTableConfiguration
is automatically set for all users in the core parser. This assumes the user has set up a model calledmetricflow_time_spine
atDAY
granularity, so that configuration is set automatically in the manifest. This config was never exposed to users in YAML. The only logic change made here for the legacy config is to make it no longer required in the JSON schema, which will help with eventual migration. The plan is to continue setting the old config automatically in the manifest until users have migrated over to the new one, using validation warnings to prompt them to migrate. MetricFlow will support both fields in the meantime.NodeRelation
changes: I renamed theNodeRelation
implementation classPydanticNodeRelation
to match all other implementation classes - previously the protocol and implementation classes had the same name. This will not be a breaking change for core/mantle because this class is never imported directly there. I also needed to move those classes to their own files to avoid circular imports. Viewing that commit separately should be helpful for review - the commit is purely copy/paste, no logic changes.semantic-layer
) and themodel
key will be implemented in core instead of here.Checklist
changie new
to create a changelog entry