Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Datetime conversion to string #4098

Merged
merged 1 commit into from
Oct 11, 2019

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.

@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