Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assorted Naming and Type Fixes #187

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

plypaul
Copy link
Contributor

@plypaul plypaul commented Oct 24, 2023

Description

  • Use nouns for fields - fill_nulls_with -> null_fill_value
  • Update the type for the null fill value to allow for floats.
  • Rename MetricInput.as_reference -> MetricInput.metric_reference
  • timespine -> time_spine in field names since it's 2 words.

Checklist

@cla-bot cla-bot bot added the cla:yes label Oct 24, 2023
@github-actions
Copy link

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

* Use nouns for fields - `fill_nulls_with` -> `null_fill_value`
* Update the type for the metric null fill value to allow for floats.
* Rename MetricInput.as_reference -> MetricInput.metric_reference
* `timespine` -> `time_spine` in variable names since it's 2 words.
@plypaul plypaul force-pushed the plypaul--53--assorted-nits branch from e29b0e6 to 0d5d374 Compare October 24, 2023 21:57
@QMalcolm
Copy link
Collaborator

@plypaul this is currently marked as a draft. Are we trying to get this into into 0.4.0 of DSI?

@QMalcolm QMalcolm mentioned this pull request Oct 25, 2023
@plypaul plypaul marked this pull request as ready for review January 10, 2024 18:22
@plypaul plypaul requested review from QMalcolm, graciegoheen and a team as code owners January 10, 2024 18:22
@plypaul
Copy link
Contributor Author

plypaul commented Jan 10, 2024

@QMalcolm - Picking this back up again. What would be the best way forward on this?

Copy link
Collaborator

@tlento tlento left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of the original blockers on this PR have changed, but for whatever reason we didn't write them down, so now I'm writing them down.

filter: Optional[PydanticWhereFilterIntersection] = None
alias: Optional[str] = None
time_spine_join: bool = False
null_fill_value: Optional[float] = None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we tried this float caused problems when the actual value is supposed to be an int.

In a perfect world we could do int | float but that doesn't appear to resolve correctly and we haven't figured out how to deal with it.

Comment on lines +49 to +55
def time_spine_join(self) -> bool:
"""If the measure should be joined to the time spine."""
pass

@property
@abstractmethod
def fill_nulls_with(self) -> Optional[int]:
def null_fill_value(self) -> Optional[float]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are hard breaking changes on the dbt-core parser so we can't push these into dbt-semantic-interfaces or take dependencies on these names in MetricFlow if we want to be able to backport things.

It's fine to add duplicate fields with the new names, and once we get support for both broadly available across the releases we are committed to supporting we can gradually remove the old ones, but given that 1) these names were chosen within the context of existing dbt metrics nomenclature and 2) they're now out in the world I'm not sure this adjustment is worth the effort.

Copy link
Collaborator

@QMalcolm QMalcolm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just want to echo everything @tlento has already said. If we aren't trying to move forward with this renames/typings should we close this for the time being?

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.

3 participants