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

Enhance Code2Parquet module to handle non-code text as well #520

Open
1 of 2 tasks
shahrokhDaijavad opened this issue Aug 19, 2024 · 5 comments
Open
1 of 2 tasks
Assignees
Labels
enhancement New feature or request

Comments

@shahrokhDaijavad
Copy link
Member

Search before asking

  • I searched the issues and found no similar issues.

Component

Other

Feature

The current version of Code2Parquet takes zip files made of text files that are all code. We need the ability to handle plain text (non-code) files as input as well.

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!
@daw3rd
Copy link
Member

daw3rd commented Aug 21, 2024

What extensions are you proposing be handled as text? Can we be more specific about requirements?

@blublinsky
Copy link
Collaborator

I do not think it matters. All the files inside zip are handled as text

@shahrokhDaijavad
Copy link
Member Author

@daw3rd The requirement to "handle" general text (code and non-code) came from Nirmit last Friday when I was showing him the new root README files. He said in addition to code, pdf and html ingestion, we should have text too. So, when I discussed this with Boris, he convinced me that the best way to do this is to generalize code2parquet to handle arbitrary text and not just code text.

@daw3rd
Copy link
Member

daw3rd commented Aug 21, 2024

That does not provide any more detail on the requirements.

  1. Do you want to import .txt files from zips similarly to how we do .pdf contained in zip?
  2. Are there other extensions?
  3. In the case of code2parquet, we know it is code (.py, .java, .c, etc.). how do we know which we're importing? Or maybe we don't put any code-specific columns?

Why not merge all html, text, pdf into the same module. Probably because of the varying requirements, but to not have text2parquet, when we already have pdf2parquet and html2parquet, breaks the pattern. I'm not convinced adapting code2parquet is the right way to go.

@shahrokhDaijavad
Copy link
Member Author

Answers and comments to your questions:

  1. Yes
  2. No
  3. I don't think Boris has changed anything that the original code2parquet was doing when the code_data parameter is by default true, so the ext column has the file extension extracted from the file path (.py, .java, ...) I assume with the new code, when code_data is false, the ext column says .txt? (@blublinsky to confirm).

When I discussed this with Boris, he mentioned the alternative option of creating an independent text2parquet, but he convinced himself (and me) that it meant duplicating almost everything that the code2parquet was doing, whereas adding a new flag to that code was much more efficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants