Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed dist/python_tabular-0.1.1-py3-none-any.whl
Binary file not shown.
Binary file removed dist/python_tabular-0.1.1.tar.gz
Binary file not shown.
Binary file removed dist/python_tabular-0.1.2-py3-none-any.whl
Binary file not shown.
Binary file removed dist/python_tabular-0.1.2.tar.gz
Binary file not shown.
Binary file removed dist/python_tabular-0.1.4-py3-none-any.whl
Binary file not shown.
Binary file removed dist/python_tabular-0.1.4.tar.gz
Binary file not shown.
Binary file removed dist/python_tabular-0.1.5-py3-none-any.whl
Binary file not shown.
Binary file removed dist/python_tabular-0.1.5.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "python_tabular"
version = "0.1.9.1"
version = "0.1.9.2"
authors = [
{ name="Curtis Stallings", email="curtisrstallings@gmail.com" },
]
Expand Down
8 changes: 7 additions & 1 deletion pytabular/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,14 @@ def Query(self, Query_Str: str) -> Union[pd.DataFrame, str, int]:
]
Results = list()
while Query.Read():
"""This is a bit garbage will need to refactor later but fixing issue with System.Decimal conversion"""
Results.append(
[Query.GetValue(index) for index in range(0, len(Column_Headers))]
[
Query.GetValue(index)
if Query.GetDataTypeName((index)) not in ("Object", "Decimal")
else Query.GetValue(index).ToDouble(Query.GetValue(index))
for index in range(0, len(Column_Headers))
]
)
Query.Close()
logger.debug("Data retrieved... reading...")
Expand Down
14 changes: 14 additions & 0 deletions test/test_tabular.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@ def test_basic_query(model):
assert int_result == 1 and text_result == "Hello World"


datatype_queries = [
["this is a string", '"this is a string"'],
[1, 1],
[1000.78, "CONVERT(1000.78,CURRENCY)"],
]


@pytest.mark.parametrize("model", testing_parameters)
def test_datatype_query(model):
for query in datatype_queries:
result = model.Query(f"EVALUATE {{{query[1]}}}")
assert result == query[0]


@pytest.mark.parametrize("model", testing_parameters)
def test_file_query(model):
singlevaltest = local.SINGLEVALTESTPATH
Expand Down