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 e2e test for converting a text column of numbers to number column fixes #1128 #1170

Conversation

ManishShah120
Copy link
Contributor

Fixes #1128

Added an e2e test for converting a text column of numbers to number column.

Technical details

Screenshots

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the master 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.

of numbers to number column.
Copy link
Member

@pavish pavish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ManishShah120 Thanks for the PR! Looks good mostly, but I have a few comments which need to be resolved before we can merge in the changes.

mathesar/tests/integration/test_columns.py Outdated Show resolved Hide resolved
mathesar/tests/integration/test_columns.py Outdated Show resolved Hide resolved
mathesar/tests/integration/test_columns.py Outdated Show resolved Hide resolved
mathesar/tests/integration/test_columns.py Outdated Show resolved Hide resolved
@pavish pavish 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 16, 2022
@pavish pavish assigned ManishShah120 and unassigned mathemancer and pavish Mar 16, 2022
@codecov-commenter
Copy link

codecov-commenter commented Mar 17, 2022

Codecov Report

Merging #1170 (b30d4f2) into master (3e4acf4) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1170   +/-   ##
=======================================
  Coverage   93.39%   93.39%           
=======================================
  Files         113      113           
  Lines        4332     4332           
=======================================
  Hits         4046     4046           
  Misses        286      286           
Flag Coverage Δ
pytest-backend 93.39% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3e4acf4...b30d4f2. Read the comment docs.

@ManishShah120
Copy link
Contributor Author

@pavish please have a look at it, if its ok to merge or if any changes is/are required.

@pavish pavish 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 18, 2022
@pavish pavish assigned pavish and mathemancer and unassigned ManishShah120 Mar 18, 2022
Copy link
Member

@pavish pavish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ManishShah120 The PR looks good to me.

I do have a couple suggestions to improve readability and re-usability of code.

  1. The fixture go_to_table_with_numbers_in_text can be made more common and provide a table which allows type conversions from text to all types (eg., text -> boolean, text -> uri etc.,), instead of being specific to 'text -> number'.
  2. The naming of column can be improved. Instead of foo, the column name could be text_column_with_numbers.

I'm not going to block this PR for these comments, but please feel free to raise another PR with these changes.

I'm approving it. I'll leave it to @mathemancer to take a look at the python code and approve as the backend reviewer.

@pavish pavish enabled auto-merge March 18, 2022 17:28
@pavish pavish disabled auto-merge March 18, 2022 17:32


@pytest.fixture
def go_to_table_with_numbers_in_text(page, patent_schema, create_column, schema, base_schema_url):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def go_to_table_with_numbers_in_text(page, patent_schema, create_column, schema, base_schema_url):

In this line it will be more appropriate to use custom_types_schema instead of patent_schema, once the PR #1199 is merged.

Copy link
Contributor

@mathemancer mathemancer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good, subject to @pavish 's suggestion about the scope of the test table. Thank you for your effort on this PR!

@pavish pavish merged commit 3ae5e0c into mathesar-foundation:master Mar 21, 2022
@ManishShah120 ManishShah120 deleted the issues/1128-convert-text-col-of-num-to-num-col branch March 21, 2022 11:50
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.

Add E2E test for converting a text column of numbers to a number column
5 participants