Skip to content

Conversation

PhilippSchmelter
Copy link
Contributor

Resolves #554
Added an explicit Exception for handling no received data from WeatherSource to prevent the pipeline moving on without data.

@PhilippSchmelter PhilippSchmelter self-assigned this Aug 27, 2024
@PhilippSchmelter
Copy link
Contributor Author

Handling CSV-Source done

  • all getWeather() which returned optional
    //TODO
    REST of
    SQL
    Influx
    Couchbase

@PhilippSchmelter PhilippSchmelter marked this pull request as ready for review September 30, 2024 22:37
@PhilippSchmelter
Copy link
Contributor Author

@danielfeismann
I think now this Issue should be covered :D
Feel free to check the changes and let me know if something doesnt fit!

Copy link
Member

@danielfeismann danielfeismann left a 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

IndividualTimeSeries<WeatherValue> timeSeries =
new IndividualTimeSeries<>(timeBasedValues);
coordinateToTimeSeries.put(entry.getKey(), timeSeries);
if (!timeBasedValues.isEmpty()) {
Copy link
Member

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

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.

Explicitly handle not receiving any weather data from the weather source
3 participants