-
Notifications
You must be signed in to change notification settings - Fork 294
tests: fix presto, add faker classes #106
Conversation
name = name.replace(r"without time zone", "n_tz") | ||
name = name.replace(r"with time zone", "y_tz") | ||
name = name.replace(r"with local time zone", "y_tz") | ||
name = name.replace(r"timestamp", "ts") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer shortening and never truncating names. That could lead to some nasty, nasty bugs down the line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a nice idea!
tests/common.py
Outdated
|
||
level = logging.ERROR | ||
if os.environ.get('DEBUG', False): | ||
level = logging.DEBUG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be more flexible to get the LOG_LEVEL
and use getattr with it.
tests/test_database_types.py
Outdated
from decimal import Decimal | ||
from prestodb.exceptions import PrestoUserError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should avoid this kind of imports.
Instead you can use import_presto()
from databases/presto.py
where it's needed.
If that's too clumsy, we can store "prestodb" in the Presto insntance, and use it as db.prestodb.exceptions.PrestoUserError
.
name = name.replace(r"without time zone", "n_tz") | ||
name = name.replace(r"with time zone", "y_tz") | ||
name = name.replace(r"with local time zone", "y_tz") | ||
name = name.replace(r"timestamp", "ts") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a nice idea!
Nice one! |
2d70092
to
6bcf104
Compare
6bcf104
to
5a173fd
Compare
First set of changes to allow the test suites to be used for benchmarking:
*Faker
classes that are capable of producing an infinite amount of rows for benchmarkingJust trying to split this up so it's easier to review