File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -532,19 +532,21 @@ def _get_meteonorm(
532532
533533 # Check for None type in case of TMY request
534534 # Check for DateParseError in case of relative times, e.g., '+3hours'
535+ # TODO: remove ValueError when our minimum pandas version is high enough
536+ # to make it unnecessary (2.0?)
535537 if (start is not None ) & (start != 'now' ):
536538 try :
537539 start = pd .Timestamp (start )
538540 start = start .tz_localize ("UTC" ) if start .tzinfo is None else start
539541 start = start .strftime ("%Y-%m-%dT%H:%M:%SZ" )
540- except DateParseError :
542+ except ( ValueError , DateParseError ) :
541543 pass
542544 if (end is not None ) & (end != 'now' ):
543545 try :
544546 end = pd .Timestamp (end )
545547 end = end .tz_localize ("UTC" ) if end .tzinfo is None else end
546548 end = end .strftime ("%Y-%m-%dT%H:%M:%SZ" )
547- except DateParseError :
549+ except ( ValueError , DateParseError ) :
548550 pass
549551
550552 params = {
You can’t perform that action at this time.
0 commit comments