e6data-python-connector 2.1.17__tar.gz → 2.1.18__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.18}/PKG-INFO +2 -2
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/README.md +1 -1
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/e6data_python_connector/datainputstream.py +5 -3
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/e6data_python_connector/date_time_utils.py +34 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18/e6data_python_connector.egg-info}/PKG-INFO +2 -2
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/setup.py +1 -1
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/LICENSE +0 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/MANIFEST.in +0 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/e6data_python_connector/__init__.py +0 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/e6data_python_connector/common.py +0 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/e6data_python_connector/constants.py +0 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/e6data_python_connector/dialect.py +0 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/e6data_python_connector/e6data_grpc.py +0 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/e6data_python_connector/e6x_vector/__init__.py +0 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/e6data_python_connector/e6x_vector/constants.py +0 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/e6data_python_connector/e6x_vector/ttypes.py +0 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/e6data_python_connector/exceptions.py +0 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/e6data_python_connector/server/QueryEngineService.py +0 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/e6data_python_connector/server/__init__.py +0 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/e6data_python_connector/server/constants.py +0 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/e6data_python_connector/server/e6x_engine_pb2.py +0 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/e6data_python_connector/server/e6x_engine_pb2.pyi +0 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/e6data_python_connector/server/e6x_engine_pb2_grpc.py +0 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/e6data_python_connector/server/ttypes.py +0 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/e6data_python_connector/typeId.py +0 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/e6data_python_connector.egg-info/SOURCES.txt +0 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/e6data_python_connector.egg-info/dependency_links.txt +0 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/e6data_python_connector.egg-info/entry_points.txt +0 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/e6data_python_connector.egg-info/requires.txt +0 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/e6data_python_connector.egg-info/top_level.txt +0 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/pyproject.toml +0 -0
- {e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/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.18
|
|
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,6 +201,7 @@ 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
|
|
@@ -232,15 +233,16 @@ def get_column_from_chunk(vector: Vector) -> list:
|
|
|
232
233
|
epoch_micros = vector.data.timeData.data[
|
|
233
234
|
row] if not vector.isConstantVector else vector.data.timeConstantData.data
|
|
234
235
|
if ((vector.isConstantVector and vector.data.timeConstantData.zoneData is not None) or
|
|
235
|
-
vector.data.timeData.zoneData is not None):
|
|
236
|
+
(not vector.isConstantVector and vector.data.timeData.zoneData is not None)):
|
|
236
237
|
zone = vector.data.timeData.zoneData[
|
|
237
238
|
row] if not vector.isConstantVector else vector.data.timeConstantData.zoneData
|
|
239
|
+
zone = timezone_from_offset(zone)
|
|
238
240
|
epoch_seconds = floor_div(epoch_micros, 1000_000)
|
|
239
241
|
micros_of_the_day = floor_mod(epoch_micros, 1000_000)
|
|
240
242
|
zone_offset = pytz.timezone(zone)
|
|
241
243
|
date_time = datetime.fromtimestamp(epoch_seconds, zone_offset)
|
|
242
244
|
date_time = date_time + timedelta(microseconds=micros_of_the_day)
|
|
243
|
-
value_array.append(date_time.
|
|
245
|
+
value_array.append(date_time.isoformat(timespec='milliseconds'))
|
|
244
246
|
elif d_type == VectorType.STRING or d_type == VectorType.ARRAY or d_type == VectorType.MAP or d_type == VectorType.STRUCT:
|
|
245
247
|
for row in range(vector.size):
|
|
246
248
|
if get_null(vector, row):
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
from datetime import datetime, timedelta
|
|
2
|
+
from typing import Final
|
|
3
|
+
import pytz
|
|
4
|
+
|
|
1
5
|
TIME_ZONES = {
|
|
2
6
|
"+12:00": ["Pacific/Kwajalein", "Pacific/Wallis", "Pacific/Funafuti", "Pacific/Nauru", "Kwajalein", "Pacific/Wake",
|
|
3
7
|
"Pacific/Norfolk", "Pacific/Tarawa", "Asia/Kamchatka", "Etc/GMT-12", "Asia/Anadyr", "Pacific/Majuro", ],
|
|
@@ -140,6 +144,8 @@ FORMATS = {
|
|
|
140
144
|
"ss": "%S"
|
|
141
145
|
}
|
|
142
146
|
|
|
147
|
+
zone_map: Final = dict()
|
|
148
|
+
|
|
143
149
|
|
|
144
150
|
def floor_div(x, y):
|
|
145
151
|
q = x // y
|
|
@@ -155,6 +161,34 @@ def floor_mod(x, y):
|
|
|
155
161
|
return r
|
|
156
162
|
|
|
157
163
|
|
|
164
|
+
def timezone_from_offset(offset_string) -> str:
|
|
165
|
+
# Parse the offset string into hours and minutes
|
|
166
|
+
sign = -1 if offset_string[0] == "-" else 1
|
|
167
|
+
if ":" in offset_string:
|
|
168
|
+
if offset_string in zone_map:
|
|
169
|
+
return zone_map[offset_string]
|
|
170
|
+
with_out_sign = offset_string[1:]
|
|
171
|
+
hours_minutes = with_out_sign.split(":")
|
|
172
|
+
hours = int(hours_minutes[0])
|
|
173
|
+
minutes = int(hours_minutes[1])
|
|
174
|
+
|
|
175
|
+
# Calculate the offset in seconds
|
|
176
|
+
total_minutes = (hours * 60 + minutes) * sign
|
|
177
|
+
offset = timedelta(minutes=total_minutes)
|
|
178
|
+
|
|
179
|
+
# Get a datetime object with the current time
|
|
180
|
+
now = datetime.now()
|
|
181
|
+
# Search for a timezone with the given offset
|
|
182
|
+
for tz_name in pytz.all_timezones:
|
|
183
|
+
tz = pytz.timezone(tz_name)
|
|
184
|
+
tz_offset = tz.utcoffset(now, is_dst=False)
|
|
185
|
+
if tz_offset == offset:
|
|
186
|
+
zone_map[offset_string] = tz_name
|
|
187
|
+
return tz_name
|
|
188
|
+
else:
|
|
189
|
+
return 'UTC' if offset_string == 'Z' else offset_string
|
|
190
|
+
|
|
191
|
+
|
|
158
192
|
def get_format(str_format):
|
|
159
193
|
if str_format is None or len(str_format) == 0:
|
|
160
194
|
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.18
|
|
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.18}/e6data_python_connector/common.py
RENAMED
|
File without changes
|
|
File without changes
|
{e6data-python-connector-2.1.17 → e6data-python-connector-2.1.18}/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.18}/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
|