-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
[druid] Catch IOError when fetching Druid datasource time boundary #3897
[druid] Catch IOError when fetching Druid datasource time boundary #3897
Conversation
The result of this query is used to determine when to look for metadata. I don't think the method should just return |
Also think we should fall back on current date time. I think that used to be the default before people said they had issues with past or future datasets. You could probably get in the git history to see how it used to be. |
3621d7f
to
7004738
Compare
@Mogball I updated the logic to revert to the current time. @mistercrunch I went through the code to where this was added, and it seems like there's never been a check for this, i.e., here's the code from 0.8.5. |
superset/connectors/druid/models.py
Outdated
max_time = dparse(max_time) | ||
try: | ||
results = client.time_boundary(datasource=self.datasource_name) | ||
if not results: |
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.
Just noticed this now but we could fall back to datetime.now()
when the function returns None
as well
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.
@Mogball I updated the logic per your comment. PTAL.
7004738
to
eb8fed4
Compare
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.
lgtm
Whilst debugging #3894 I noticed that the calling the PyDruid client
time_boundary(...)
function, anIOError
can be thrown as described here.This PR ensures we catch the exception and simply return
None
which is consistent with the case that no results are obtained.to: @mistercrunch @Mogball @xrmx