Skip to content

Commit

Permalink
Merge pull request #12 from sumeshi/feature/v0.3.6
Browse files Browse the repository at this point in the history
Feature/v0.3.6
  • Loading branch information
sumeshi authored Nov 9, 2024
2 parents 8465636 + 13e478e commit a04530d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "qsv"
version = "0.3.5"
version = "0.3.6"
description = "A tool that provides elastic and rapid filtering for efficient analysis of huge CSV files, such as eventlogs."
readme = "README.md"
authors = [
Expand Down
13 changes: 8 additions & 5 deletions src/qsv/controllers/DataFrameController.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,14 @@ def changetz(
logger.debug(f"change {colname} timezone {timezone_from} to {timezone_to}.")
self.__check_exists_colnames([colname])

if datetime_format:
self.df = self.df.with_columns(pl.col(colname).str.to_datetime(datetime_format))
else:
self.df = self.df.with_columns(pl.col(colname).str.to_datetime())

# convert string to datetime
if self.df.select(colname).collect_schema().dtypes()[0] != pl.Datetime:
if datetime_format:
self.df = self.df.with_columns(pl.col(colname).str.to_datetime(datetime_format))
else:
self.df = self.df.with_columns(pl.col(colname).str.to_datetime())

# setup and change timezone
self.df = self.df.with_columns(pl.col(colname).dt.replace_time_zone(timezone_from))
self.df = self.df.with_columns(pl.col(colname).dt.convert_time_zone(timezone_to))
return self
Expand Down
6 changes: 3 additions & 3 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a04530d

Please sign in to comment.