Skip to content

[FIX] Datetime conversion to string#4098

Merged
lanzagar merged 1 commit intobiolab:masterfrom
rokgomiscek:datetime_string_conversion
Oct 11, 2019
Merged

[FIX] Datetime conversion to string#4098
lanzagar merged 1 commit intobiolab:masterfrom
rokgomiscek:datetime_string_conversion

Conversation

@rokgomiscek
Copy link
Contributor

Issue

Fixes #3963

Description of changes

Added additional branch when converting to string.

Includes
  • Code changes
  • Tests
  • Documentation

@codecov
Copy link

codecov bot commented Oct 11, 2019

Codecov Report

Merging #4098 into master will not change coverage.
The diff coverage is 100%.

@@           Coverage Diff           @@
##           master    #4098   +/-   ##
=======================================
  Coverage   85.56%   85.56%           
=======================================
  Files         385      385           
  Lines       69220    69220           
=======================================
  Hits        59228    59228           
  Misses       9992     9992

Comment on lines +325 to +327
elif type(orig_var) == TimeVariable:
col_data = [orig_var.repr_val(x) if not np.isnan(x) else ""
for x in self._iter_vals(col_data)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks to be the same as in the above if type(orig_var) == DiscreteVariable,
we could change the first check to match both types, e.g. if type(orig_var) in (DiscreteVariable, TimeVariable),
so we can avoid copy/pasting code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Changed.

@rokgomiscek rokgomiscek force-pushed the datetime_string_conversion branch from 26f83d4 to daee584 Compare October 11, 2019 13:39
@lanzagar lanzagar merged commit b6c901e into biolab:master Oct 11, 2019
@rokgomiscek rokgomiscek deleted the datetime_string_conversion branch October 11, 2019 14:26
janezd pushed a commit to janezd/orange3 that referenced this pull request Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File: conversion to string destroys datetime

2 participants