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

Added support for semicolon-separated value files #2759

Conversation

Aritra8438
Copy link
Member

@Aritra8438 Aritra8438 commented Mar 28, 2023

This PR Fixes #2753

Technical details:
Currently Mathesar allows importing DSV files with following delimiters:
,
\t
:
|
This pull request adds support for importing semicolon ; separated values files as well.

Additional references:
Mathesar uses clevercsv to detect the possible delimiter(s) of a file.
from the docs, I have noted the following definitions that might be relevant.

  • block_char (iterable) – Characters that are in the Punctuation Other category but that
    should not be considered as escape character. If None, the default set is used, equal to:
    "!", "?", '"', "'", ".", ",", ";", ":", "%", "*"

  • quote_chars (iterable) – Characters that should be considered quote characters. If it is
    None, the following default set is used:
    "'", '"', "~", ""`

  • delimiters (iterable) – List of delimiters to consider. If None, the get_delimiters() function is used to automatically detect the delimiter

Semicolon is included in the set of block_chars, that means it's a potential candidate for being a delimiter.

Apart from that, I have tested the underlying logic of selecting delimiter for a given file on Google Colab and am attaching the same with this pull request to get this verified by you.

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the develop branch of the repository
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no
    visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@Aritra8438
Copy link
Member Author

Also, attaching a screencast of the working feature,

dsv.mp4

@rajatvijay rajatvijay requested a review from dmos62 March 29, 2023 12:23
@rajatvijay rajatvijay added the pr-status: review A PR awaiting review label Mar 29, 2023
@rajatvijay rajatvijay added this to the Backlog milestone Mar 29, 2023
@Aritra8438
Copy link
Member Author

Hi, @rajatvijay. Should I do anything about the failure of Run Python Tests?

@dmos62
Copy link
Contributor

dmos62 commented Mar 30, 2023

@Aritra8438 yes, please fix the failing test/s.

@dmos62 dmos62 added pr-status: revision A PR awaiting follow-up work from its author after review and removed pr-status: review A PR awaiting review labels Mar 30, 2023
@dmos62 dmos62 assigned Aritra8438 and unassigned dmos62 Mar 30, 2023
@Aritra8438
Copy link
Member Author

@Aritra8438 yes, please fix the failing test/s.

I have fixed it.

@rajatvijay rajatvijay assigned dmos62 and unassigned Aritra8438 Mar 31, 2023
@rajatvijay rajatvijay added pr-status: review A PR awaiting review and removed pr-status: revision A PR awaiting follow-up work from its author after review labels Mar 31, 2023
@dmos62 dmos62 added this pull request to the merge queue Mar 31, 2023
Merged via the queue into mathesar-foundation:develop with commit 3be97be Mar 31, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-status: review A PR awaiting review
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Support Importing Semicolon Separated Values file
3 participants