e6data-python-connector 2.1.17__tar.gz → 2.1.19__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {e6data-python-connector-2.1.17/e6data_python_connector.egg-info → e6data_python_connector-2.1.19}/PKG-INFO +2 -2
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/README.md +1 -1
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector/datainputstream.py +9 -9
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector/date_time_utils.py +23 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19/e6data_python_connector.egg-info}/PKG-INFO +2 -2
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/setup.py +1 -1
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/LICENSE +0 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/MANIFEST.in +0 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector/__init__.py +0 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector/common.py +0 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector/constants.py +0 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector/dialect.py +0 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector/e6data_grpc.py +0 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector/e6x_vector/__init__.py +0 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector/e6x_vector/constants.py +0 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector/e6x_vector/ttypes.py +0 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector/exceptions.py +0 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector/server/QueryEngineService.py +0 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector/server/__init__.py +0 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector/server/constants.py +0 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector/server/e6x_engine_pb2.py +0 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector/server/e6x_engine_pb2.pyi +0 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector/server/e6x_engine_pb2_grpc.py +0 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector/server/ttypes.py +0 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector/typeId.py +0 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector.egg-info/SOURCES.txt +0 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector.egg-info/dependency_links.txt +0 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector.egg-info/entry_points.txt +0 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector.egg-info/requires.txt +0 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector.egg-info/top_level.txt +0 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/pyproject.toml +0 -0
- {e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: e6data-python-connector
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.19
|
|
4
4
|
Summary: Client for the e6data distributed SQL Engine.
|
|
5
5
|
Home-page: https://github.com/e6x-labs/e6data-python-connector
|
|
6
6
|
Author: Uniphi, Inc.
|
|
@@ -27,7 +27,7 @@ Requires-Dist: sqlalchemy
|
|
|
27
27
|
|
|
28
28
|
# e6data Python Connector
|
|
29
29
|
|
|
30
|
-

|
|
31
31
|
|
|
32
32
|
## Introduction
|
|
33
33
|
|
|
@@ -8,7 +8,7 @@ from thrift.transport import TTransport
|
|
|
8
8
|
|
|
9
9
|
from e6data_python_connector.e6x_vector.ttypes import Chunk, Vector, VectorType
|
|
10
10
|
from e6data_python_connector.constants import ZONE
|
|
11
|
-
from e6data_python_connector.date_time_utils import floor_div, floor_mod,
|
|
11
|
+
from e6data_python_connector.date_time_utils import floor_div, floor_mod, timezone_from_offset
|
|
12
12
|
|
|
13
13
|
try:
|
|
14
14
|
from thrift.protocol import fastbinary
|
|
@@ -201,10 +201,11 @@ def read_rows_from_chunk(query_columns_description: list, buffer):
|
|
|
201
201
|
return rows
|
|
202
202
|
|
|
203
203
|
|
|
204
|
+
|
|
204
205
|
def get_column_from_chunk(vector: Vector) -> list:
|
|
205
206
|
value_array = list()
|
|
206
207
|
d_type = vector.vectorType
|
|
207
|
-
zone =
|
|
208
|
+
zone = pytz.UTC
|
|
208
209
|
try:
|
|
209
210
|
if d_type == VectorType.LONG:
|
|
210
211
|
for row in range(vector.size):
|
|
@@ -221,8 +222,7 @@ def get_column_from_chunk(vector: Vector) -> list:
|
|
|
221
222
|
epoch_seconds = floor_div(vector.data.dateData.data[
|
|
222
223
|
row] if not vector.isConstantVector else vector.data.dateConstantData.data,
|
|
223
224
|
1000_000)
|
|
224
|
-
|
|
225
|
-
date = datetime.fromtimestamp(epoch_seconds, zone_offset)
|
|
225
|
+
date = datetime.fromtimestamp(epoch_seconds, zone)
|
|
226
226
|
value_array.append(date.strftime("%Y-%m-%d"))
|
|
227
227
|
elif d_type == VectorType.DATETIME:
|
|
228
228
|
for row in range(vector.size):
|
|
@@ -232,15 +232,15 @@ def get_column_from_chunk(vector: Vector) -> list:
|
|
|
232
232
|
epoch_micros = vector.data.timeData.data[
|
|
233
233
|
row] if not vector.isConstantVector else vector.data.timeConstantData.data
|
|
234
234
|
if ((vector.isConstantVector and vector.data.timeConstantData.zoneData is not None) or
|
|
235
|
-
vector.data.timeData.zoneData is not None):
|
|
236
|
-
|
|
235
|
+
(not vector.isConstantVector and vector.data.timeData.zoneData is not None)):
|
|
236
|
+
zone_id = vector.data.timeData.zoneData[
|
|
237
237
|
row] if not vector.isConstantVector else vector.data.timeConstantData.zoneData
|
|
238
|
+
zone = timezone_from_offset(zone_id)
|
|
238
239
|
epoch_seconds = floor_div(epoch_micros, 1000_000)
|
|
239
240
|
micros_of_the_day = floor_mod(epoch_micros, 1000_000)
|
|
240
|
-
|
|
241
|
-
date_time = datetime.fromtimestamp(epoch_seconds, zone_offset)
|
|
241
|
+
date_time = datetime.fromtimestamp(epoch_seconds, zone)
|
|
242
242
|
date_time = date_time + timedelta(microseconds=micros_of_the_day)
|
|
243
|
-
value_array.append(date_time.
|
|
243
|
+
value_array.append(date_time.isoformat(timespec='milliseconds'))
|
|
244
244
|
elif d_type == VectorType.STRING or d_type == VectorType.ARRAY or d_type == VectorType.MAP or d_type == VectorType.STRUCT:
|
|
245
245
|
for row in range(vector.size):
|
|
246
246
|
if get_null(vector, row):
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
from typing import Final
|
|
2
|
+
import pytz
|
|
3
|
+
|
|
1
4
|
TIME_ZONES = {
|
|
2
5
|
"+12:00": ["Pacific/Kwajalein", "Pacific/Wallis", "Pacific/Funafuti", "Pacific/Nauru", "Kwajalein", "Pacific/Wake",
|
|
3
6
|
"Pacific/Norfolk", "Pacific/Tarawa", "Asia/Kamchatka", "Etc/GMT-12", "Asia/Anadyr", "Pacific/Majuro", ],
|
|
@@ -140,6 +143,8 @@ FORMATS = {
|
|
|
140
143
|
"ss": "%S"
|
|
141
144
|
}
|
|
142
145
|
|
|
146
|
+
zone_map: Final = dict()
|
|
147
|
+
|
|
143
148
|
|
|
144
149
|
def floor_div(x, y):
|
|
145
150
|
q = x // y
|
|
@@ -155,6 +160,24 @@ def floor_mod(x, y):
|
|
|
155
160
|
return r
|
|
156
161
|
|
|
157
162
|
|
|
163
|
+
def timezone_from_offset(offset_string) -> pytz:
|
|
164
|
+
# Parse the offset string into hours and minutes
|
|
165
|
+
sign = -1 if offset_string[0] == "-" else 1
|
|
166
|
+
if ":" in offset_string:
|
|
167
|
+
if offset_string in zone_map:
|
|
168
|
+
return zone_map[offset_string]
|
|
169
|
+
with_out_sign = offset_string[1:]
|
|
170
|
+
hours_minutes = with_out_sign.split(":")
|
|
171
|
+
hours = int(hours_minutes[0])
|
|
172
|
+
minutes = int(hours_minutes[1])
|
|
173
|
+
total_minutes = (hours * 60 + minutes) * sign
|
|
174
|
+
fixed_offset = pytz.FixedOffset(total_minutes)
|
|
175
|
+
zone_map[offset_string] = fixed_offset
|
|
176
|
+
return pytz.FixedOffset(total_minutes)
|
|
177
|
+
else:
|
|
178
|
+
return pytz.UTC if offset_string == 'Z' else pytz.timezone(offset_string)
|
|
179
|
+
|
|
180
|
+
|
|
158
181
|
def get_format(str_format):
|
|
159
182
|
if str_format is None or len(str_format) == 0:
|
|
160
183
|
return "%Y-%m-%d %H:%M:%S"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: e6data-python-connector
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.19
|
|
4
4
|
Summary: Client for the e6data distributed SQL Engine.
|
|
5
5
|
Home-page: https://github.com/e6x-labs/e6data-python-connector
|
|
6
6
|
Author: Uniphi, Inc.
|
|
@@ -27,7 +27,7 @@ Requires-Dist: sqlalchemy
|
|
|
27
27
|
|
|
28
28
|
# e6data Python Connector
|
|
29
29
|
|
|
30
|
-

|
|
31
31
|
|
|
32
32
|
## Introduction
|
|
33
33
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector/common.py
RENAMED
|
File without changes
|
|
File without changes
|
{e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector/dialect.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{e6data-python-connector-2.1.17 → e6data_python_connector-2.1.19}/e6data_python_connector/typeId.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|