Hello everyone, I have a question about `session_i...
# questions
f
Hello everyone, I have a question about
session_id
. I noticed that
session.create()
uses
generate_timestamp()
to provide a version number. However, this function is fixed to the UTC timezone, and I need to change it to UTC + n timezone. Besides directly modifying or inheriting to override
session.create()
Does anyone know if there is a way to set the
session_id
? Thanks!
Copy code
def generate_timestamp() -> str:
    """Generate the timestamp to be used by versioning.

    Returns:
        String representation of the current timestamp.

    """
    current_ts = datetime.now(tz=timezone.utc).strftime(VERSION_FORMAT)
    return current_ts[:-4] + current_ts[-1:]  # Don't keep microseconds
https://docs.kedro.org/en/0.19.6/_modules/kedro/framework/session/session.html
h
Someone will reply to you shortly. In the meantime, this might help:
m
Why do you need to change it?
f
~Because I am in the UTC + n time zone, the user prefers to use the current time zone as the main reference. Currently, I inherit the session.create method to modify it.~
Because I am in the UTC + n time zone, the user prefers to use the current time zone as the main reference. Currently, I inherit the session.create method to modify it.
m
Hi @FU SIAO, at the moment it's not possible to set the session_id. Patching it is currently the only way. We've got an open issue on this https://github.com/kedro-org/kedro/issues/1731, but currently it's not a priority.
f
ok, thanks for the reply