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

Make primary descriptor fn aware of which description it's calculating #10299 #10300

Merged
merged 1 commit into from
Dec 1, 2023

Conversation

jacobtylerwalls
Copy link
Member

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Description of Change

See use case in #10299: when overriding this function, it may be useful to know which kind of descriptor is being resolved.

Issues Solved

Closes #10299

@bferguso
Copy link
Contributor

bferguso commented Nov 28, 2023

@jacobtylerwalls, @chiatt - Unless I'm missing something, I think this should already be available in the config parameter. This is how I'm determining this in my custom descriptors:

            if config["type"] == "name":
                .... logic ...

A full (not super clean) example is here: https://github.com/bcgov/BCHeritage_arches/blob/main/src/arches_bchp/arches_bchp/pkg/extensions/functions/bcrhp-site-descriptors/bcrhp_site_descriptors.py

@jacobtylerwalls
Copy link
Member Author

Thanks for linking out to your implementation @bferguso. That approach would require altering the function config.

What do you think about the current approach on this PR? Is it a benefit that the function configs wouldn't have to be altered?

@bferguso
Copy link
Contributor

Hi @jacobtylerwalls - I think that makes perfect sense. I'd forgotten that I'd modified my local function configs to make it work so I think what you've proposed is great.

Copy link
Member

@chiatt chiatt left a comment

Choose a reason for hiding this comment

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

Looks good!

@chiatt chiatt merged commit bdb36dc into dev/7.5.x Dec 1, 2023
2 checks passed
@chiatt chiatt deleted the 10299-primary-descriptor-which-descriptor branch December 1, 2023 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants