[
https://issues.apache.org/jira/browse/CASSANDRA-18879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17792241#comment-17792241
]
Arun Ganesh commented on CASSANDRA-18879:
-----------------------------------------
> The method date_time_from_timestamp is indeed imported from the driver and
> used exactly one. Are you suggesting there is a better replacement?
No, I was just asking if I had to modify that too. Then, there's nothing to
modify in `formatting.py`. Let me raise a PR so that you can see the changes.
> Hum, it shouldn't timeout except occasionally. They run fine for me on a
> MacBook Air with Cassandra installed locally. Your machine isn't swapping is
> it (free -m)?
Let me check again. So, can I assume if the `cassandra-cqlsh-tests.sh` passes,
nothing is breaking?
> Modernize CQLSH datetime conversions
> ------------------------------------
>
> Key: CASSANDRA-18879
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18879
> Project: Cassandra
> Issue Type: Improvement
> Components: CQL/Interpreter
> Reporter: Brad Schoening
> Assignee: Arun Ganesh
> Priority: Low
>
> Python 3.x introduced many updates to datetime conversion which allows
> simplified conversions.
> 1. For example, tracing.py defines a function datetime_from_utc_to_local()
> but datetime now has a native function astimezone() which will convert UTC to
> local time.
> Review the following users of datetime which apply conversions:
> * cqlshmain.py
> * formatting.py
> * tracing.py
> Example:
> {code:java}
> >>> a = datetime.datetime.now().astimezone(tz.tzutc())
> >>> a
> datetime.datetime(2023, 9, 25, 11, 22, 36, 251705, tzinfo=tzutc())
> >>> b = a.astimezone()
> >>> b
> datetime.datetime(2023, 9, 25, 14, 22, 36, 251705,
> tzinfo=datetime.timezone(datetime.timedelta(seconds=10800), 'EEST')) {code}
> See [PEP 495|https://peps.python.org/pep-0495/]
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]