-
Notifications
You must be signed in to change notification settings - Fork 6
Handling no received data from WeatherSource #1145
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
base: dev
Are you sure you want to change the base?
Conversation
This reverts commit 529bf23
src/main/java/edu/ie3/datamodel/exceptions/NoWeatherDataException.java
Outdated
Show resolved
Hide resolved
…d changed NoDataException
Handling CSV-Source done
|
@danielfeismann |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for including my points. I do have another one or two points which are a bit unclear to me
src/main/java/edu/ie3/datamodel/exceptions/NoDataException.java
Outdated
Show resolved
Hide resolved
src/test/groovy/edu/ie3/datamodel/io/source/influxdb/InfluxDbWeatherSourceIconIT.groovy
Outdated
Show resolved
Hide resolved
src/test/groovy/edu/ie3/datamodel/io/source/influxdb/InfluxDbWeatherSourceCosmoIT.groovy
Show resolved
Hide resolved
IndividualTimeSeries<WeatherValue> timeSeries = | ||
new IndividualTimeSeries<>(timeBasedValues); | ||
coordinateToTimeSeries.put(entry.getKey(), timeSeries); | ||
if (!timeBasedValues.isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it also lead to an exception in case timeBasedValues is empty, since one could assume we would expect weather data when asking for it and those aren't there? Not sure about this, I might have to rethink on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, testing this would also be great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested throwing an exception when timeBasedValues is empty, but that broke existing behavior and tests. For now we keep it simple: invalid coordinates throw a NoDataException, but valid coordinates with no data just return an empty series. Or do we really want it that strict? If so we could use my last commit which I reverted again.
Resolves #554
Added an explicit Exception for handling no received data from WeatherSource to prevent the pipeline moving on without data.