Skip to content

Commit

Permalink
Disable generation of hyperd.log (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
fxstempfelals committed Apr 11, 2024
1 parent 535f51a commit b3c06a7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions newsfragments/291.fix
@@ -0,0 +1 @@
Disables generation of tableauhyperapi's hyperd.log file.
3 changes: 2 additions & 1 deletion src/pantab/_reader.py
Expand Up @@ -59,7 +59,8 @@ def frames_from_hyper(

table_names = []
with tempfile.TemporaryDirectory() as tmp_dir, tab_api.HyperProcess(
tab_api.Telemetry.DO_NOT_SEND_USAGE_DATA_TO_TABLEAU
tab_api.Telemetry.DO_NOT_SEND_USAGE_DATA_TO_TABLEAU,
parameters={"log_config": ""},
) as hpe:
tmp_db = shutil.copy(source, tmp_dir)
with tab_api.Connection(hpe.endpoint, tmp_db) as connection:
Expand Down
14 changes: 14 additions & 0 deletions tests/test_reader.py
@@ -1,3 +1,5 @@
import pathlib

import pandas as pd
import pandas.testing as tm
import tableauhyperapi as tab_api
Expand Down Expand Up @@ -128,3 +130,15 @@ def test_reader_handles_duplicate_columns(tmp_hyper):

df = pt.frame_from_hyper_query(tmp_hyper, "SELECT 1 as col, 2 AS col, 3 AS col")
assert df.columns.tolist() == ["col", "col_1", "col_2"]


def test_frame_from_hyper_doesnt_generate_hyperd_log(frame, tmp_hyper):
pt.frame_to_hyper(frame, tmp_hyper, table="test")
pt.frame_from_hyper(tmp_hyper, table="test")
assert not pathlib.Path("hyperd.log").is_file()


def test_frames_from_hyper_doesnt_generate_hyperd_log(frame, tmp_hyper):
pt.frame_to_hyper(frame, tmp_hyper, table="test")
pt.frames_from_hyper(tmp_hyper)
assert not pathlib.Path("hyperd.log").is_file()

0 comments on commit b3c06a7

Please sign in to comment.