Skip to content

Commit d44f7c5

Browse files
Prefix utility/library modules inside of Duct collections with '_'.
1 parent cf90061 commit d44f7c5

File tree

8 files changed

+13
-13
lines changed

8 files changed

+13
-13
lines changed
File renamed without changes.
File renamed without changes.

omniduct/databases/base.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from omniduct.utils.magics import (MagicsProvider, process_line_arguments,
1919
process_line_cell_arguments)
2020

21-
from . import cursor_formatters
21+
from . import _cursor_formatters
2222

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

@@ -63,12 +63,12 @@ class DatabaseClient(Duct, MagicsProvider):
6363
DEFAULT_PORT = None
6464

6565
CURSOR_FORMATTERS = {
66-
'pandas': cursor_formatters.PandasCursorFormatter,
67-
'hive': cursor_formatters.HiveCursorFormatter,
68-
'csv': cursor_formatters.CsvCursorFormatter,
69-
'tuple': cursor_formatters.TupleCursorFormatter,
70-
'dict': cursor_formatters.DictCursorFormatter,
71-
'raw': cursor_formatters.RawCursorFormatter,
66+
'pandas': _cursor_formatters.PandasCursorFormatter,
67+
'hive': _cursor_formatters.HiveCursorFormatter,
68+
'csv': _cursor_formatters.CsvCursorFormatter,
69+
'tuple': _cursor_formatters.TupleCursorFormatter,
70+
'dict': _cursor_formatters.DictCursorFormatter,
71+
'raw': _cursor_formatters.RawCursorFormatter,
7272
}
7373
DEFAULT_CURSOR_FORMATTER = 'pandas'
7474
SUPPORTS_SESSION_PROPERTIES = False
@@ -341,7 +341,7 @@ def stream(self, statement, format=None, format_opts={}, batch=None, **kwargs):
341341

342342
def _get_formatter(self, formatter, cursor, **kwargs):
343343
formatter = formatter or self.DEFAULT_CURSOR_FORMATTER
344-
if not (inspect.isclass(formatter) and issubclass(formatter, cursor_formatters.CursorFormatter)):
344+
if not (inspect.isclass(formatter) and issubclass(formatter, _cursor_formatters.CursorFormatter)):
345345
assert formatter in self.CURSOR_FORMATTERS, "Invalid format '{}'. Choose from: {}".format(formatter, ','.join(self.CURSOR_FORMATTERS.keys()))
346346
formatter = self.CURSOR_FORMATTERS[formatter]
347347
return formatter(cursor, **kwargs)

omniduct/databases/hiveserver2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from omniduct.utils.processes import Timeout, run_in_subprocess
1515

1616
from .base import DatabaseClient
17-
from .schemas import SchemasMixin
17+
from ._schemas import SchemasMixin
1818

1919

2020
class HiveServer2Client(DatabaseClient, SchemasMixin):

omniduct/databases/presto.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from omniduct.utils.debug import logger
1414

1515
from .base import DatabaseClient
16-
from .schemas import SchemasMixin
16+
from ._schemas import SchemasMixin
1717

1818

1919
class PrestoClient(DatabaseClient, SchemasMixin):

omniduct/databases/sqlalchemy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import absolute_import
22

33
from .base import DatabaseClient
4-
from .schemas import SchemasMixin
4+
from ._schemas import SchemasMixin
55

66

77
class SQLAlchemyClient(DatabaseClient, SchemasMixin):
File renamed without changes.

omniduct/filesystems/webhdfs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def _init(self, namenodes=None, auto_conf=False, auto_conf_cluster=None,
4343
self.namenodes = namenodes
4444

4545
if auto_conf:
46-
from .webhdfs_helpers import CdhHdfsConfParser
46+
from ._webhdfs_helpers import CdhHdfsConfParser
4747

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

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

6161
def _connect(self):
62-
from .webhdfs_helpers import OmniductPyWebHdfsClient
62+
from ._webhdfs_helpers import OmniductPyWebHdfsClient
6363
self.__webhdfs = OmniductPyWebHdfsClient(
6464
host=self._host,
6565
port=self._port,

0 commit comments

Comments
 (0)