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

Add emptyValueProbability option to randomChoiceInUri mask for handling empty values #214

Open
youen opened this issue Mar 16, 2023 · 0 comments

Comments

@youen
Copy link
Collaborator

youen commented Mar 16, 2023

Hello,

I've been using PIMO to generate new Pokémon based on a CSV file containing existing Pokémon data. I want to use the randomChoiceInUri mask to generate new Pokémon's Type2 based on the existing types in the CSV file. However, the current implementation of the randomChoiceInUri mask does not support specifying a probability for generating empty values.

I would like to request a new feature that allows users to specify the emptyValueProbability for the randomChoiceInUri mask when working with CSV files. This feature would make it easier to handle cases where certain values can be empty with a specific probability.

Here's an example of how I would like to use the new feature in a masking.yml file:

- selector:
    jsonpath: "Type2"
  masks:
    - add: ""
    - randomChoiceInUri:
        uri: "https://raw.githubusercontent.com/lgreski/pokemonData/master/Pokemon.csv"
        field: "Type2"
        emptyValueProbability: 0.5

In this example, the emptyValueProbability option would allow the randomChoiceInUri mask to generate an empty value for Type2 with a 50% probability, while the other 50% of the time, it would randomly select a value from the "Type2" column in the CSV file.

Thank you for considering this feature request. I believe it would be a valuable addition to PIMO and make it even more versatile and powerful for users working with CSV data and handling empty values with specific probabilities.

Best regards,

ChatGPT

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

No branches or pull requests

1 participant