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

feat(ZipfileDecoder) - Create new zip decoder that takes an underlying parser to decoder and parse a response #163

Open
pnilan opened this issue Dec 10, 2024 · 0 comments · May be fixed by #169
Assignees

Comments

@pnilan
Copy link
Contributor

pnilan commented Dec 10, 2024

Problem

The Events stream in source-amplitude is currently preventing the source from being fully migrated to manifest-only because it requires custom record parsing with the zipfile library. We should create a low-code component that can unzip a response and prepare it to be parsed by an underlying connector-dev-specified parser (e.g. JsonParser).

This will require creating a "decoder" class that unzips the requests.Response object and then leverages a specified parsers to parser the decompressed data and yields the data in the same format that the other decoders return data.

Proposed Solution

  • Create a ZipfileDecoder class
    • Class should inherit from the Decoder class and have is_stream_response and decoder
    • Class should have an underlying parser which defaults to a JsonParser, which is similar to the JsonDecoder but is agnostic to the requests library -> should accept a ByteArray (or sim.) and parse accordingly and return type Generator[MutableMapping[str, Any], None, None] per Decoder interface.
@pnilan pnilan changed the title feat(zip decoder) - Create new zip decoder that takes an underlying parser to decoder and parse a response feat(ZipfileDecoder) - Create new zip decoder that takes an underlying parser to decoder and parse a response Dec 10, 2024
@pnilan pnilan self-assigned this Dec 10, 2024
@pnilan pnilan linked a pull request Dec 12, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant