Skip to content

deltatime of None is raising an error instead of outputting "N/A" in long_form()#843

Merged
tkeffer merged 1 commit into
weewx:masterfrom
roe-dl:long_form_none
Feb 4, 2023
Merged

deltatime of None is raising an error instead of outputting "N/A" in long_form()#843
tkeffer merged 1 commit into
weewx:masterfrom
roe-dl:long_form_none

Conversation

@roe-dl

@roe-dl roe-dl commented Feb 4, 2023

Copy link
Copy Markdown
Contributor

If the deltatime value is None, the new funktion long_form() is raising an error. To output "N/A" (or what is configured to be used in this case) I re-used the first lines of format() and added the parameter None_string.

@tkeffer

tkeffer commented Feb 4, 2023

Copy link
Copy Markdown
Contributor

Can you give me an example of where long_form raises an error if given a value of None? There is a unit test for this, and it seems to be working fine.

See https://github.com/weewx/weewx/blob/master/bin/weewx/tests/test_units.py#L203

@tkeffer

tkeffer commented Feb 4, 2023

Copy link
Copy Markdown
Contributor

My apologies. Now I see the problem.

tkeffer added a commit that referenced this pull request Feb 4, 2023
Add PR #843 to change log.

Add unit test.
@tkeffer tkeffer merged commit 82c6495 into weewx:master Feb 4, 2023
@tkeffer

tkeffer commented Feb 4, 2023

Copy link
Copy Markdown
Contributor

Thanks, Karen!

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.

2 participants