GithubHelp home page GithubHelp logo

Comments (4)

mrmwink avatar mrmwink commented on June 6, 2024 1

Ah, that makes perfect sense, as ever Scott your explanation is on point.

I can also go back to my team now and give them a heads up 👍

I guess you can never be 100% certain that is the case with the scope and naming, only takes a small error when generating one of them and you might get an issue!

Cheers, keep up the awesome work.

from dataverse-gen.

scottdurow avatar scottdurow commented on June 6, 2024

Hi @mrmwink - great to have you on board!

There are two types of choice columns, local definitions and global definitions:
image

The naming of local enums is (scope)_(choices-logical-name), the nameing of global enums is just (choices-logical-name)

The scope part for enums on local choice columns for entities will be the logical name of the entity, whilst for actions, it will be the name of the action. It's important to have this scope disambiguation to ensure that entity choices and action choices don't collide.

Since the accountcategorycode is a 'local' choice column, the scope is 'account' and the choice-logical-name is account_accountcategorycode - hence you see the double prefix - account_account_accountcategorycode

For global choices, there is no disambiguation prefix, and the logical name will just be the logical name of the choices - e.g. myprefix_mychoicesname

Since the default is to create global choices ('Sync with global choice' in the screenshot above) - you won't see the disambiguation for your custom choice columns.

Dataverse-gen could perform some optimisation where it looks for name collisions and only prefixes where needed - but I chose to go for consistency instead. If you re-name enums then it will make it difficult to re-generate the metadata and so I recommend against it - and it may seem strange having the scope disambiguation - until you find there is an action that has the same choice logical name but a different set of choices!

I hope this makes sense!

from dataverse-gen.

scottdurow avatar scottdurow commented on June 6, 2024

All that said - if we can guarantee that the choices-logical-name for actions and entities is always unique, then we perhaps do not need the scope prefix.

from dataverse-gen.

scottdurow avatar scottdurow commented on June 6, 2024

Great - glad this helped 😊
The collisions tend to happen with 'legacy' actions where the logical names were created literally over a decade ago. The more recent metadata is much more consistent. I'll close this for now - perhaps we can revisit it later.

from dataverse-gen.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.