-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
chore: ci Initial hive support #10593
Conversation
d69e8e9
to
a13658d
Compare
Codecov Report
@@ Coverage Diff @@
## master #10593 +/- ##
==========================================
- Coverage 64.36% 60.35% -4.02%
==========================================
Files 785 785
Lines 36981 36987 +6
Branches 3530 3530
==========================================
- Hits 23803 22323 -1480
- Misses 13070 14477 +1407
- Partials 108 187 +79
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
a13658d
to
d5537e1
Compare
9e42631
to
31c1647
Compare
315a75e
to
0eaf1db
Compare
requirements/testing.in
Outdated
@@ -16,7 +16,10 @@ | |||
# | |||
-r base.in | |||
-r integration.in | |||
ipdb | |||
ipython==7.16.1 |
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.
Nit. ABC. Also why pin ipython
?
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.
Added comment:
# pinning ipython as pip-compile-multi was bringing higher version
# of the ipython that was not found in CI
@@ -14,18 +14,27 @@ | |||
# KIND, either express or implied. See the License for the | |||
# specific language governing permissions and limitations | |||
# under the License. | |||
# isort:skip_file |
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.
Why is this necessary? I prefer the previous logic on 23.
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.
from superset import db needs to be called after test_app import
e.g. https://github.com/apache/incubator-superset/blob/fd2d1c58c566d9312d6cfc5641a06ac2b03e753a/tests/sqllab_tests.py#L27
FYI @bkyryliuk this needs a rebase |
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 few minor comments, for the most part looks good!
strategy: | ||
matrix: | ||
# run unit tests in multiple version just for fun | ||
python-version: [3.6, 3.7, 3.8] |
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'd suggest dropping 3.6 from new tests going forward.
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.
sure thing
ipython-genutils==0.2.0 # via traitlets | ||
ipython==7.16.1 # via -r requirements/testing.in, ipdb |
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.
This is surprising, do we need this dependency?
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.
this is for ipdb, it CI had issues locationg ipython > 7.16.1, I'll try it again.
As for ipdb - I like using it inside tox, that's why added to the test dependencies. It provides really nice debugging experience.
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.
update github actions still are unable to install ipython 7.17.0
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.
Nice, I'll try it out 👍
tests/csv_upload_tests.py
Outdated
if utils.backend() == "hive": | ||
# Be aware that hive only uses first value from the null values list | ||
# it can be fixes if we will process csv file on the superset webserver. | ||
assert data == [("john", 1, "x"), ("paul", 2, None)] | ||
else: | ||
assert data == [(None, 1, "x"), ("paul", 2, None)] |
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 didn't quite understand this, why is "john" showing up here on Hive when other dbs return None
?
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.
see the comment above, hive has it's own csv upload implementation and only supports a single null value where as default implementation works with the list. [ hive engine limitation ]
It can manually process csv to make it feature complete. Updated the comment to be more descriptive & added a todo
@@ -18,6 +18,7 @@ | |||
from sqlalchemy.dialects import oracle | |||
from sqlalchemy.dialects.oracle import DATE, NVARCHAR, VARCHAR | |||
|
|||
from superset.db_engine_specs.hive import HiveEngineSpec |
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 assume this isn't needed here?
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.
good catch :)
tests/model_tests.py
Outdated
expected = ( | ||
textwrap.dedent( | ||
f"""\ | ||
SELECT source, | ||
target, | ||
value | ||
FROM {table_name} | ||
LIMIT 100""" | ||
# TODO(bkyryliuk): unify sql generation | ||
if db.backend == "presto": | ||
assert ( | ||
'SELECT "source" AS "source",\n "target" AS "target",\n "value" AS "value"\nFROM "energy_usage"\nLIMIT 100' | ||
== sql | ||
) | ||
if db.backend != "presto" | ||
else textwrap.dedent( | ||
f"""\ | ||
SELECT "source" AS "source", | ||
"target" AS "target", | ||
"value" AS "value" | ||
FROM "{table_name}" | ||
LIMIT 100""" | ||
elif db.backend == "hive": | ||
assert ( | ||
"SELECT `source`,\n `target`,\n `value`\nFROM `energy_usage`\nLIMIT 100" | ||
== sql | ||
) | ||
else: | ||
assert ( | ||
"SELECT source,\n target,\n value\nFROM energy_usage\nLIMIT 100" | ||
in sql |
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.
nit/personal preference: I kind of preferred the appearance of textwrap.dedent
over this.
ca0ae41
to
c44cd22
Compare
5f4f914
to
ba74384
Compare
ba74384
to
66fe3a4
Compare
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.
LGTM 👍
ipython-genutils==0.2.0 # via traitlets | ||
ipython==7.16.1 # via -r requirements/testing.in, ipdb |
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.
Nice, I'll try it out 👍
* Initial hive support * Clone hive setup * Make hive tests work locally * Debugging presto failure * sleep in dataset test * Address comments * Address comments * Pin ipython, exclude new pylint rules Co-authored-by: bogdan kyryliuk <[email protected]>
* Initial hive support * Clone hive setup * Make hive tests work locally * Debugging presto failure * sleep in dataset test * Address comments * Address comments * Pin ipython, exclude new pylint rules Co-authored-by: bogdan kyryliuk <[email protected]>
* Initial hive support * Clone hive setup * Make hive tests work locally * Debugging presto failure * sleep in dataset test * Address comments * Address comments * Pin ipython, exclude new pylint rules Co-authored-by: bogdan kyryliuk <[email protected]>
* Initial hive support * Clone hive setup * Make hive tests work locally * Debugging presto failure * sleep in dataset test * Address comments * Address comments * Pin ipython, exclude new pylint rules Co-authored-by: bogdan kyryliuk <[email protected]>
SUMMARY
Hive tests
Related cleanup
Side effects:
Followed https://hub.docker.com/r/bde2020/hive/ as an example
TEST PLAN
Mostly test only changes, CI