We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3009088 commit 36f6007Copy full SHA for 36f6007
python/pyspark/sql/types.py
@@ -188,7 +188,8 @@ def toInternal(self, dt):
188
189
def fromInternal(self, ts):
190
if ts is not None:
191
- return datetime.datetime.fromtimestamp(ts / 1e6)
+ # using int to avoid precision loss in float
192
+ return datetime.datetime.fromtimestamp(ts // 1000000).replace(microsecond=ts % 1000000)
193
194
195
class DecimalType(FractionalType):
0 commit comments