Skip to content

Commit

Permalink
Prefix utility/library modules inside of Duct collections with '_'.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewwardrop committed Aug 20, 2018
1 parent cf90061 commit d44f7c5
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions omniduct/databases/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from omniduct.utils.magics import (MagicsProvider, process_line_arguments,
process_line_cell_arguments)

from . import cursor_formatters
from . import _cursor_formatters

logging.getLogger('requests').setLevel(logging.WARNING)

Expand Down Expand Up @@ -63,12 +63,12 @@ class DatabaseClient(Duct, MagicsProvider):
DEFAULT_PORT = None

CURSOR_FORMATTERS = {
'pandas': cursor_formatters.PandasCursorFormatter,
'hive': cursor_formatters.HiveCursorFormatter,
'csv': cursor_formatters.CsvCursorFormatter,
'tuple': cursor_formatters.TupleCursorFormatter,
'dict': cursor_formatters.DictCursorFormatter,
'raw': cursor_formatters.RawCursorFormatter,
'pandas': _cursor_formatters.PandasCursorFormatter,
'hive': _cursor_formatters.HiveCursorFormatter,
'csv': _cursor_formatters.CsvCursorFormatter,
'tuple': _cursor_formatters.TupleCursorFormatter,
'dict': _cursor_formatters.DictCursorFormatter,
'raw': _cursor_formatters.RawCursorFormatter,
}
DEFAULT_CURSOR_FORMATTER = 'pandas'
SUPPORTS_SESSION_PROPERTIES = False
Expand Down Expand Up @@ -341,7 +341,7 @@ def stream(self, statement, format=None, format_opts={}, batch=None, **kwargs):

def _get_formatter(self, formatter, cursor, **kwargs):
formatter = formatter or self.DEFAULT_CURSOR_FORMATTER
if not (inspect.isclass(formatter) and issubclass(formatter, cursor_formatters.CursorFormatter)):
if not (inspect.isclass(formatter) and issubclass(formatter, _cursor_formatters.CursorFormatter)):
assert formatter in self.CURSOR_FORMATTERS, "Invalid format '{}'. Choose from: {}".format(formatter, ','.join(self.CURSOR_FORMATTERS.keys()))
formatter = self.CURSOR_FORMATTERS[formatter]
return formatter(cursor, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion omniduct/databases/hiveserver2.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from omniduct.utils.processes import Timeout, run_in_subprocess

from .base import DatabaseClient
from .schemas import SchemasMixin
from ._schemas import SchemasMixin


class HiveServer2Client(DatabaseClient, SchemasMixin):
Expand Down
2 changes: 1 addition & 1 deletion omniduct/databases/presto.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from omniduct.utils.debug import logger

from .base import DatabaseClient
from .schemas import SchemasMixin
from ._schemas import SchemasMixin


class PrestoClient(DatabaseClient, SchemasMixin):
Expand Down
2 changes: 1 addition & 1 deletion omniduct/databases/sqlalchemy.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import absolute_import

from .base import DatabaseClient
from .schemas import SchemasMixin
from ._schemas import SchemasMixin


class SQLAlchemyClient(DatabaseClient, SchemasMixin):
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions omniduct/filesystems/webhdfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _init(self, namenodes=None, auto_conf=False, auto_conf_cluster=None,
self.namenodes = namenodes

if auto_conf:
from .webhdfs_helpers import CdhHdfsConfParser
from ._webhdfs_helpers import CdhHdfsConfParser

assert auto_conf_cluster is not None, "You must specify a cluster via `auto_conf_cluster` for auto-detection to work."

Expand All @@ -59,7 +59,7 @@ def get_host_and_set_namenodes(duct, cluster, conf_path):
self.prepared_fields += ('namenodes',)

def _connect(self):
from .webhdfs_helpers import OmniductPyWebHdfsClient
from ._webhdfs_helpers import OmniductPyWebHdfsClient
self.__webhdfs = OmniductPyWebHdfsClient(
host=self._host,
port=self._port,
Expand Down

0 comments on commit d44f7c5

Please sign in to comment.