Skip to content

Commit b3d6bfe

Browse files
committed
Fix circular imports
1 parent 7468cae commit b3d6bfe

File tree

6 files changed

+15
-17
lines changed

6 files changed

+15
-17
lines changed

rbc/heavydb.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from .thrift.utils import resolve_includes
1414
from .thrift import Client as ThriftClient
1515
from . import heavyai
16-
from .omniscidb import RemoteOmnisci
1716
from .heavyai import (
1817
OmnisciArrayType, OmnisciBytesType, OmnisciTextEncodingDictType,
1918
OmnisciOutputColumnType, OmnisciColumnType,
@@ -1473,3 +1472,8 @@ def remote_call(self, func, ftype: typesystem.Type, arguments: tuple, hold=False
14731472
return numpy.array(list(result), dtype).view(numpy.recarray)
14741473
else:
14751474
return dtype[0][1](list(result)[0][0])
1475+
1476+
1477+
class RemoteOmnisci(RemoteHeavyDB):
1478+
"""Omnisci - the previous brand of HeavyAI
1479+
"""

rbc/omniscidb.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
import warnings
1+
import warnings # noqa: F401
2+
from .heavydb import * # noqa: F401, F403
23

3-
from rbc.heavydb import RemoteHeavyDB
44

5-
6-
class RemoteOmnisci(RemoteHeavyDB):
7-
"""Omnisci - the previous brand of HeavyAI
8-
"""
9-
msg = "`RemoteOmnisci` is deprecated, use `RemoteHeavyDB` instead."
10-
warnings.warn(msg, PendingDeprecationWarning)
5+
msg = "`RemoteOmnisci` is deprecated, use `RemoteHeavyDB` instead."
6+
warnings.warn(msg, PendingDeprecationWarning)

rbc/tests/heavyai/test_array.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import os
22
from collections import defaultdict
33

4-
import rbc.omniscidb
54
from rbc.heavyai import Array
65
from rbc.errors import OmnisciServerError
76
from rbc.stdlib import array_api
@@ -17,7 +16,7 @@
1716
def heavydb():
1817
# TODO: use heavydb_fixture from rbc/tests/__init__.py
1918
config = rbc_heavydb.get_client_config(debug=not True)
20-
m = rbc.omniscidb.RemoteOmnisci(**config)
19+
m = rbc_heavydb.RemoteHeavyDB(**config)
2120
table_name = os.path.splitext(os.path.basename(__file__))[0]
2221

2322
m.sql_execute(f'DROP TABLE IF EXISTS {table_name}')

rbc/tests/heavyai/test_array_functions.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import pytest
22
import numpy as np
33

4-
import rbc.omniscidb
54
from rbc.stdlib import array_api
65
from numba.core import types
76

@@ -15,7 +14,7 @@
1514
def heavydb():
1615
# TODO: use heavydb_fixture from rbc/tests/__init__.py
1716
config = rbc_heavydb.get_client_config(debug=not True)
18-
m = rbc.omniscidb.RemoteOmnisci(**config)
17+
m = rbc_heavydb.RemoteHeavyDB(**config)
1918
table_name = 'rbc_test_heavydb_array'
2019

2120
m.sql_execute(f'DROP TABLE IF EXISTS {table_name}')

rbc/tests/heavyai/test_array_math.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import pytest
22
import numpy as np
33
import rbc.heavyai as omni # noqa: F401
4-
import rbc.omniscidb
54
from rbc.stdlib import array_api
65

76

@@ -14,7 +13,7 @@
1413
def heavydb():
1514
# TODO: use heavydb_fixture from rbc/tests/__init__.py
1615
config = rbc_heavydb.get_client_config(debug=not True)
17-
m = rbc.omniscidb.RemoteOmnisci(**config)
16+
m = rbc_heavydb.RemoteHeavyDB(**config)
1817
table_name = 'rbc_test_heavydb_array'
1918

2019
m.sql_execute(f'DROP TABLE IF EXISTS {table_name}')

rbc/tests/heavyai/test_math.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
import sys
44
import numpy as np
55
import numba as nb
6+
7+
import rbc.heavydb
68
import rbc.heavydb as rbc_heavydb
7-
import rbc.omniscidb
89
from rbc.stdlib import array_api
910

1011
available_version, reason = rbc_heavydb.is_available()
@@ -21,7 +22,7 @@ def nb_version():
2122
def heavydb():
2223
# TODO: use heavydb_fixture from rbc/tests/__init__.py
2324
config = rbc_heavydb.get_client_config(debug=not True)
24-
m = rbc.omniscidb.RemoteOmnisci(**config)
25+
m = rbc_heavydb.RemoteHeavyDB(**config)
2526
table_name = 'rbc_test_heavydb_math'
2627

2728
m.sql_execute(f'DROP TABLE IF EXISTS {table_name}')

0 commit comments

Comments
 (0)