Skip to content
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

Conversation

john-bodley
Copy link
Member

Whilst debugging #3894 I noticed that the calling the PyDruid client time_boundary(...) function, an IOError 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

@Mogball
Copy link
Contributor

Mogball commented Nov 17, 2017

The result of this query is used to determine when to look for metadata. I don't think the method should just return None if that fails. It could probably just use the current time or something instead.

@mistercrunch
Copy link
Member

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.

@john-bodley john-bodley force-pushed the john-bodley-druid-datasource-time-boundary-fix branch from 3621d7f to 7004738 Compare November 18, 2017 00:46
@john-bodley
Copy link
Member Author

@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.

max_time = dparse(max_time)
try:
results = client.time_boundary(datasource=self.datasource_name)
if not results:
Copy link
Contributor

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

Copy link
Member Author

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.

@john-bodley john-bodley force-pushed the john-bodley-druid-datasource-time-boundary-fix branch from 7004738 to eb8fed4 Compare November 18, 2017 03:46
Copy link
Contributor

@Mogball Mogball left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mistercrunch mistercrunch merged commit 3a7ed8d into apache:master Nov 18, 2017
michellethomas pushed a commit to michellethomas/panoramix that referenced this pull request May 24, 2018
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.21.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.21.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants