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

Remove test using Tiny/bad-assets-data.csv (and file) #812

Open
clizbe opened this issue Sep 20, 2024 · 3 comments
Open

Remove test using Tiny/bad-assets-data.csv (and file) #812

clizbe opened this issue Sep 20, 2024 · 3 comments
Labels
good first issue Good for newcomers Type: improvement Better way of doing something Zone: testing Related to improving or fixing the tests

Comments

@clizbe
Copy link
Member

clizbe commented Sep 20, 2024

What and Why

This file was used for testing and is out of date. If we still use it, we should update it. Otherwise, remove.

Possible Drawbacks

No response

Related Issues

No response

@clizbe clizbe added Type: improvement Better way of doing something Zone: data & import Interfacing between database and Julia question Marker that this issue should be discussed at the next meeting good first issue Good for newcomers labels Sep 20, 2024
@datejada
Copy link
Member

We use it to test if the type defined in the data differs from the one specified in the code (e.g., Integer and then having a String in the file). It doesn't need to be updated since the idea is to test that you get an error if you read a file with a bad schema; see the screenshot below:

image

So, I don't think this is an issue. But, just in case, let's double-check with @suvayu before closing it, who was the person who recommended this test at the beginning 😄

@suvayu
Copy link
Member

suvayu commented Sep 24, 2024

Indeed, testing for malformed/incorrect input files is a good thing, but I don't think that test actually does that. The test is actually "testing" if the dict holding all the schemas has a schema called "bad_assets_data", which is not really a useful test. In pseudo-code, the test should look like this:

schema = TEM.get_schema("assets_data")
@test_throws <ExceptionType> TIO.create_tbl(con, ...; types = schema)

Ideally you would catch a specific exception, but if that's not possible you should also check the error message. So if the <ExceptionType> is ErrorException, there should be a follow-up like this:

@test_throws r"<regex matching message>" TIO.create_tbl(con, "/path/to/bad_assets_data.csv"; types = schema)

The code duplication is unavoidable due to Julia testing library limitations. You can see this example from TIO.

@suvayu
Copy link
Member

suvayu commented Sep 24, 2024

Actually, you can drop this test, because this should be tested in TIO, which I think it already is.

EDIT: Maybe the test in TIO can be extended to add a bad data test, I see that now it only tests for success, no failure

@clizbe clizbe changed the title Update or remove Tiny/bad-assets-data.csv Remove test using Tiny/bad-assets-data.csv (and file) Sep 25, 2024
@clizbe clizbe added Zone: testing Related to improving or fixing the tests and removed question Marker that this issue should be discussed at the next meeting Zone: data & import Interfacing between database and Julia labels Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers Type: improvement Better way of doing something Zone: testing Related to improving or fixing the tests
Projects
None yet
Development

No branches or pull requests

3 participants