Skip to content

Commit

Permalink
Fixed small bugs; added test for ilike operation
Browse files Browse the repository at this point in the history
  • Loading branch information
xmnlab committed Jun 18, 2018
1 parent d1e76b0 commit 5a342c8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ibis/mapd/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ def alter_user(
self, name, password=None, is_super=None, insert_access=None
):
"""
Create a new MapD database
Alter MapD user parameters
Parameters
----------
Expand Down
18 changes: 18 additions & 0 deletions ibis/mapd/tests/test_operations.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ibis
import numpy as np
import pandas as pd
import pytest

from pytest import param
Expand Down Expand Up @@ -33,3 +34,20 @@
def test_operations_scalar(alltypes, result_fn, expected):
result = result_fn(alltypes).execute()
np.testing.assert_allclose(result, expected)


@pytest.mark.parametrize(('result_fn', 'check_result'), [
param(
lambda t: (
t[t.date_string_col][t.date_string_col.ilike('10/%')].limit(1)
),
lambda v: v.startswith('10/'),
id='string_ilike'
)
])
def test_string_operations(alltypes, result_fn, check_result):
result = result_fn(alltypes).execute()

if isinstance(result, pd.DataFrame):
result = result.values[0][0]
assert check_result(result)
2 changes: 1 addition & 1 deletion ibis/tests/all/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
pytest.param(Impala, marks=pytest.mark.impala)
]

if sys.version_info.major == 3:
if sys.version_info.major > 2:
params_backend.append(pytest.param(MapD, marks=pytest.mark.mapd))


Expand Down

0 comments on commit 5a342c8

Please sign in to comment.