dlt-hub/dlt

implement include and exclude filters in Schema as data item transformations

Offen

#64 geöffnet am 14.09.2022

 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (589 Forks)github user discovery
good first issue

Repository-Metriken

Stars
 (5.765 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 7T 7h) (54 gemergte PRs in 30 T)

Beschreibung

row filtering can be done in item transform and be added optionally to any resource. implementation in Schema is slow and only solves problems it has created :)

here's a GPT-4 prompt that writes correct function

Write me a function in python that takes a nested dictionary as input. the dictionary can contain dictionaries, lists and basic types as values. the keys are string. the function takes two more arguments: a list of exclude regexes and a list of include regexes. the regex is matching paths in the dictionary. the paths are similar to json path but a separator is __ if given element has a path matching exclude regex it is removed from dictionary. however if any of the nested (child) elements of that element matches include path it should stay but other elements should be removed

testing: normalize tests are using various advanced modes of filtering. they must pass with new function

Contributor Guide