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

[PROPOSAL] RandomDate : use "now/currentDate" for minDate or maxDate #186

Open
EricSimon opened this issue Nov 28, 2022 · 6 comments
Open

Comments

@EricSimon
Copy link
Collaborator

In order to reuse automatically the masking and to preserve data consitency. It would be interesting to be able to configure minDate or maxDate with the current date (or currentDate +/-i)

@EricSimon
Copy link
Collaborator Author

EricSimon commented Nov 30, 2022

Examples :

masks: 
      - add: ""
      - randDate:
          dateMin: "2022-01-01T00:00:00Z"
          dateMax: "now"
masks: 
      - add: ""
      - randDate:
          dateMin: "now"
          dateMax: "2022-12-31T00:00:00Z"

example with offset (day) :

masks: 
      - add: ""
      - randDate:
          dateMin: "now - 1"
          dateMax: "now +1"

@EricSimon
Copy link
Collaborator Author

now is in UTC

@adrienaury
Copy link
Member

adrienaury commented Nov 30, 2022

Ok for the "now" value.

But "now + 1", ... can be handled with existing masks :

@youen
Copy link
Collaborator

youen commented Nov 30, 2022

For long process the now value is the current time at pimo startup or the current time when the mask is applied for each line (like the sprig function now() in template) ?

@EricSimon
Copy link
Collaborator Author

I think that "now" should be valued only one time for consistency and performance

@adrienaury
Copy link
Member

adrienaury commented Nov 30, 2022

I think that "now" should be valued only one time for consistency and performance

For add-transient we defined a "cleanup" process that is executed by a mask once at the end of the pipeline (see https://github.com/CGI-FR/PIMO/blob/main/pkg/addtransient/add-transient.go#L63), maybe we should use a similar process for "init" (i.e. execute a code once, before the pipeline) ?

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

3 participants