Skip to content

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

@youen

Description

@youen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions