-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
feat: allow fetching other datasets (obf, opff, opf) #223
Conversation
f7ab588
to
2d113d0
Compare
}, | ||
Flavor.obf: { | ||
DatasetType.jsonl: "openbeautyfacts-products.jsonl.gz", | ||
DatasetType.csv: "en.openbeautyfacts.org.products.csv", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the obf, opff & opf datasets don't seem to have .csv.gz
files (getting 404).
so I used plain .csv
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
obf, opff, opf use an old version of Product Opener so this is expected. The migration to a more recent version is in progress (but it needs quite a lot of work).
@@ -57,7 +73,12 @@ def get_dataset( | |||
|
|||
|
|||
class ProductDataset: | |||
def __init__(self, dataset_type: DatasetType = DatasetType.jsonl, **kwargs): | |||
def __init__( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slight breaking change, as the documentation gives an explicit usage example with ProductDataset("csv")
, which will not work anymore
// instead
ProductDataset(dataset_type="csv")
// or
from openfoodfacts.types import Flavor
ProductDataset(flavor=Flavor.off, dataset_type="csv")
2d113d0
to
7862959
Compare
Quality Gate passedIssues Measures |
My bad, it's now functional! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me, thank you for the PR!
Description
The current
ProductDataset
implementation only allows to fetch the OFF (food) dataSolution
ProductDataset
to allow fetching other datasets: OBF, OPFF, OPFRelated issue(s)