CGI-FR / CGI-FR/PIMO

Add emptyValueProbability option to randomChoiceInUri mask for handling empty values

Open
#214 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
44
Forks
16
PR merge metrics
No merged PRs in 30d

Description

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:

```yaml
- 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

Contributor guide

Open the contributing guide

Research direction

Start by locating the randomChoiceInUri mask implementation and the masking.yml option parsing, then inspect how CSV fields and empty values are currently handled. Done means the example configuration accepts emptyValueProbability and randomChoiceInUri produces an empty value at the requested probability while retaining random selection for the remaining cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.