Skip to content

Commit

Permalink
Remove debugging prints and add a test for prints (#768)
Browse files Browse the repository at this point in the history
* Remove debugging prints and add a test for prints

* No longer should we merge PRs that contain debugging prints
* Cleans up several test files where prints were left
* Add a test `grep`ing for print statements

Fix bash script

Update script

Remove travis file

* Add print check to lint testing

* Only check package files (non-stress test files) for prints
  • Loading branch information
devin-petersohn authored Nov 4, 2019
1 parent 8058c73 commit 4661e81
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
with:
python-version: '3.7.x'
architecture: 'x64'
- run: pip install flake8
- run: flake8 .
- run: pip install flake8 flake8-print
- run: flake8 --enable=T modin
test-all:
needs: [lint-flake8, lint-black]
runs-on: ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion modin/pandas/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3280,7 +3280,6 @@ def compute_offset(value):
if key.start is None:
return self.head(compute_offset(key.stop))
elif key.stop is None:
print(compute_offset(-key.start))
return self.tail(compute_offset(-key.start))
return self.head(compute_offset(key.stop)).tail(compute_offset(-key.start))
# We convert to a RangeIndex because getitem_row_array is expecting a list
Expand Down
1 change: 0 additions & 1 deletion modin/pandas/test/performance-tests/test_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
# def test_read_csv(benchmark):
# path = "~/Downloads/201710k.csv"
# result = benchmark(pd.read_csv, path)
# print(result)


def test_sum(benchmark):
Expand Down
5 changes: 0 additions & 5 deletions modin/pandas/test/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ def test_dataframe_api_equality():
ignore = ["timetuple"]
missing_from_modin = set(pandas_dir) - set(modin_dir)
assert not len(missing_from_modin - set(ignore))

assert not len(set(modin_dir) - set(pandas_dir))

# These have to be checked manually
Expand Down Expand Up @@ -134,15 +133,13 @@ def test_series_api_equality():
ignore = ["timetuple"]
missing_from_modin = set(pandas_dir) - set(modin_dir)
assert not len(missing_from_modin - set(ignore)), missing_from_modin

assert not len(set(modin_dir) - set(pandas_dir)), set(modin_dir) - set(pandas_dir)

# These have to be checked manually
allowed_different = ["to_hdf", "hist"]
difference = []

for m in modin_dir:
print(m)
if m in allowed_different:
continue
try:
Expand Down Expand Up @@ -174,6 +171,4 @@ def test_series_api_equality():
difference.append(append_val)
except IndexError:
pass

print(difference)
assert not len(difference), "Differences found in API: {}".format(difference)
1 change: 0 additions & 1 deletion modin/pandas/test/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1685,7 +1685,6 @@ def test_loc(data):
modin_series, pandas_series = create_test_series(data)
for v in modin_series.index:
df_equals(modin_series.loc[v], pandas_series.loc[v])
print(v)
df_equals(modin_series.loc[v:], pandas_series.loc[v:])

indices = [True if i % 3 == 0 else False for i in range(len(modin_series.index))]
Expand Down
2 changes: 0 additions & 2 deletions modin/pandas/test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,6 @@ def df_equals(df1, df2):
assert df1.dtypes == df2.dtypes
else:
if df1 != df2:
print(df1)
print(df2)
np.testing.assert_almost_equal(df1, df2)


Expand Down
3 changes: 1 addition & 2 deletions modin/sql/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def execute(self, query):
self._insert_into(split_query)
else:
raise NotImplementedError(
"This API is for demonstration purposes " "only. Coming Soon!"
"This API is for demonstration purposes only. Coming Soon!"
)

def _create_table(self, split_query):
Expand All @@ -45,7 +45,6 @@ def _insert_into(self, split_query):
values = " ".join(split_query[4:]).replace("(", "").replace(")", "").split(", ")
to_append = Series([eval(i) for i in values], index=table.columns)
self._tables[split_query[2]] = table.append(to_append, ignore_index=True)
print(self._tables[split_query[2]])


def connect(name):
Expand Down

0 comments on commit 4661e81

Please sign in to comment.