dlt-hub / dlt-init-openapi

MIT License
20 stars 3 forks source link

Hackathon: chargebee source #79

Closed AstrakhantsevaAA closed 6 months ago

AstrakhantsevaAA commented 6 months ago

Problems:

  1. Auth was generated with username as a string, it should be a secret:

        source_config: RESTAPIConfig = {
            "client": {
                "base_url": base_url,
                "auth": {
                    "type": "http_basic",
                    "username": "username", # should be a variable 
                    "password": password,
                },
            },

    Funny fact: if I set username as a dlt secret, then dlt will take var ENV $USERNAME

  2. Run pipeline: should be "offset_param": "next_offset",

  3. Total in items issue:

    fixed with replacing in dlt.sources.helpers.rest_client.paginators.RangePaginator.update_state

                if total is None:
                    total = len(response_json["list"])
                    # self._handle_missing_total(response_json)

    full tracebacks you can find here https://www.notion.so/dlthub/Alena-Chargebee-e390697e31b44dd48b7afeee48096688?pvs=4

Highlights:

Notes:

sh-rp commented 6 months ago

Hey @AstrakhantsevaAA, thanks for your review! I have created two ticket for the generator here:

Did you create a ticket for the paginator in the main repo or should I do this too? And let me know if I overlooked anything that should get an additional ticket.

sh-rp commented 6 months ago

PS: Secrets toml is generated, maybe you used and older version of the generator.

AstrakhantsevaAA commented 6 months ago

@sh-rp Thank for tickets!

Did you create a ticket for the paginator in the main repo or should I do this too?

I didn't but I can do that.

And let me know if I overlooked anything

autogenerate gitignore file? our regular, with secret.toml and .duckdb

AstrakhantsevaAA commented 6 months ago

Could you also replace dashes "-" in source names, e.g. "chargebee-pipeline" to "chargebee_pipeline", I cannot import module with dashes in name. And add empty init.py in the "chargebee-pipeline" folder automatically

sh-rp commented 6 months ago

Could you also replace dashes "-" in source names, e.g. "chargebee-pipeline" to "chargebee_pipeline", I cannot import module with dashes in name. And add empty init.py in the "chargebee-pipeline" folder automatically this is coming with the next release

sh-rp commented 6 months ago

gitignore is now also created. and I check the secrets.toml has all the vars. if no auth is detected, it will still prepare a secrets toml with the right sections for later use.