Skip to content

Commit

Permalink
Revert to feat/sparkSql state (svenkreiss#92 aka feat/sparkSQL aka 1c…
Browse files Browse the repository at this point in the history
  • Loading branch information
tools4origins committed Nov 26, 2019
1 parent 084584c commit 61d1496
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
variable-rgx=[a-z0-9_]{1,30}$
good-names=log

disable=invalid-name,unused-argument,too-few-public-methods,no-self-use,missing-docstring,logging-format-interpolation,too-many-instance-attributes,duplicate-code,too-many-public-methods,too-many-arguments,protected-access,pointless-string-statement,too-many-lines,useless-object-inheritance,cyclic-import
disable=invalid-name,unused-argument,too-few-public-methods,no-self-use,missing-docstring,logging-format-interpolation,too-many-instance-attributes,duplicate-code,too-many-public-methods,too-many-arguments,protected-access,pointless-string-statement,too-many-lines,useless-object-inheritance,cyclic-import,bad-option-value
# TODO: cyclic-import is temporary


Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
dist: xenial
language: python
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
- "3.7"
- "pypy"
- "3.8"
- "pypy3"
install:
- pip install --upgrade pip
- "if [[ $TRAVIS_PYTHON_VERSION != 'pypy'* ]]; then pip install pylzma; fi"
Expand Down
5 changes: 4 additions & 1 deletion pysparkling/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@

# Python 2 compatibility
if not hasattr(time, 'perf_counter'):
time.perf_counter = time.clock
try: # Python 2
time.perf_counter = time.clock
except AttributeError: # Unexpected
raise Exception("`time`should contain either clock (py2) or perf_counter (py3)")


log = logging.getLogger(__name__)
Expand Down
10 changes: 10 additions & 0 deletions pysparkling/tests/test_resolve_filenames.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def test_s3_1():


def test_hdfs_resolve_filenames_with_wildcard():
# hdfs is an optional dependency
# pylint: disable=C0415
from pysparkling.fileio.fs import Hdfs
Hdfs.client_and_path = staticmethod(lambda *args, **kwargs: (MockedHdfsClient(), "unused_path"))

Expand All @@ -80,6 +82,8 @@ def test_hdfs_resolve_filenames_with_wildcard():


def test_hdfs_resolve_filenames_with_folder_path():
# hdfs is an optional dependency
# pylint: disable=C0415
from pysparkling.fileio.fs import Hdfs
Hdfs.client_and_path = staticmethod(lambda *args, **kwargs: (MockedHdfsClient(), "unused_path"))

Expand All @@ -92,6 +96,8 @@ def test_hdfs_resolve_filenames_with_folder_path():


def test_hdfs_resolve_filenames_with_folder_path_and_trailing_slash():
# hdfs is an optional dependency
# pylint: disable=C0415
from pysparkling.fileio.fs import Hdfs
Hdfs.client_and_path = staticmethod(lambda *args, **kwargs: (MockedHdfsClient(), "unused_path"))

Expand All @@ -104,6 +110,8 @@ def test_hdfs_resolve_filenames_with_folder_path_and_trailing_slash():


def test_hdfs_resolve_filenames_with_file_path():
# hdfs is an optional dependency
# pylint: disable=C0415
from pysparkling.fileio.fs import Hdfs
Hdfs.client_and_path = staticmethod(lambda *args, **kwargs: (MockedHdfsClient(), "unused_path"))

Expand All @@ -115,6 +123,8 @@ def test_hdfs_resolve_filenames_with_file_path():


def test_s3_resolve_filenames():
# boto is an optional dependency
# pylint: disable=C0415
from pysparkling.fileio.fs import S3
S3._get_conn = classmethod(lambda *args, **kwargs: MockedS3Connection())

Expand Down

0 comments on commit 61d1496

Please sign in to comment.