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

Latest time macro #697

Merged
merged 3 commits into from
May 16, 2018
Merged

Latest time macro #697

merged 3 commits into from
May 16, 2018

Conversation

deepakb91
Copy link
Collaborator

No description provided.

physicalTableSchema.getPhysicalColumnName(_ as String) >> ""
physicalTableSchema.getColumns() >> Collections.emptySet()

SimplifiedIntervalList simplifiedIntervalList1 = Mock(SimplifiedIntervalList)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of creating a Mock of SimplifiedIntervalList, should just create two new SimplifiedIntervalList

        SimplifiedIntervalList simplifiedIntervalList1 = new SimplifiedIntervalList([interval1] as Set)
        SimplifiedIntervalList simplifiedIntervalList2 = new SimplifiedIntervalList([interval2] as Set)

ConfigPhysicalTable configPhysicalTable1 = Mock(ConfigPhysicalTable)
ConfigPhysicalTable configPhysicalTable2 = Mock(ConfigPhysicalTable)
configPhysicalTable1.getAvailability() >> availability1
configPhysicalTable1.getAvailableIntervals() >> intervalList1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of getAvailableIntervals(), should use getAllAvailableIntervals() as it was used here

Copy link
Collaborator

@tarrantzhang tarrantzhang left a comment

Choose a reason for hiding this comment

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

Code-wise looks good. I do not 100% understand the purpose of this PR though. Adding some reference in the PR description will help a lot.

@deepakb91 deepakb91 merged commit 5d56d11 into master May 16, 2018
@deepakb91 deepakb91 deleted the LatestTimeMacro branch May 16, 2018 22:38
@@ -145,6 +145,9 @@ Thanks to everyone who contributed to this release!

### Added:

- [Logical Table Availability](https://github.com/yahoo/fili/pull/697)
* Added `logicalTableAvailability` to `TableUtils` which returns the union of availabilities for the logical table.

Copy link
Contributor

Choose a reason for hiding this comment

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

This comment is incorrect.

@@ -6,6 +6,8 @@
* Feature flags bind an object to a system configuration name.
*/
public enum BardFeatureFlag implements FeatureFlag {

CURRENT_MACRO_USES_LATEST("current_macro_uses_latest"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Where's the comment for this PR?

@michael-mclawhorn
Copy link
Contributor

michael-mclawhorn commented May 17, 2018 via email

Copy link
Collaborator

@cdeszaq cdeszaq left a comment

Choose a reason for hiding this comment

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

There's so much that is missing from this PR. Why did it get merged?

DateTime firstUnavailableInstant = TableUtils.logicalTableAvailability(getTable()).getLast().getEnd();
DateTime adjustedNow = firstUnavailableInstant.isBeforeNow() ? firstUnavailableInstant : new DateTime();

this.intervals = generateIntervals(adjustedNow, intervals, this.granularity, dateTimeFormatter);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where's the test for this? And the documentation for what the feature flag is doing?

DateTimeFormatter dateTimeFormatter = generateDateTimeFormatter(timeZone);

this.intervals = generateIntervals(intervals, this.granularity, dateTimeFormatter);
if (BardFeatureFlag.CURRENT_MACRO_USES_LATEST.isOn()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why isn't this able to be handled by swapping the MacroCalculationStrategy for the CURRENT macro? There's already an extension point around macro behavior, so why doesn't it work for this use-case?



/**
* Extracts the set of intervals from the api request.
Copy link
Collaborator

Choose a reason for hiding this comment

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

How is this version of the method different from the one that doesn't take "now"? Why would the caller choose to use one over the other?

DateTimeFormatter dateTimeFormatter = generateDateTimeFormatter(timeZone);

this.intervals = generateIntervals(intervals, this.granularity, dateTimeFormatter);
if (BardFeatureFlag.CURRENT_MACRO_USES_LATEST.isOn()) {
DateTime firstUnavailableInstant = TableUtils.logicalTableAvailability(getTable()).getLast().getEnd();
Copy link
Collaborator

Choose a reason for hiding this comment

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

How is this correct if it doesn't take in query constraints?

@michael-mclawhorn
Copy link
Contributor

@cdeszaq https://github.com/yahoo/fili/pull/702/files is a partial remedy to this PR, but it certainly deserves a larger discussion. Unfortunately, when that yahoo-oath transition happened, all of the fili core team members who had access to the https://groups.google.com/forum/#!forum/fili-users and https://groups.google.com/forum/#!forum/fili-developers lost their ability to connect.

We haven't really established a forum for public discussions outside of issues and I think this needs more of a retro discussion than an issue. Do you still have admin access to those groups such that you could open them up a little wider?

@cdeszaq
Copy link
Collaborator

cdeszaq commented May 23, 2018

@michael-mclawhorn Yes, a bit broader discussion would be good. Time is hard, and a lot of deep thought, sweat, blood, and tears when into Fili's treatment of it, so I would hate for that to be lost or made less reliable.

As for those groups:
I do still have admin access (yay for personal accounts!), and they appear to still be wide open to the public for posting (no account needed), so there shouldn't be any problem there for the fili-users and fili-developers forums. I see that you've created a 2nd account on one of them with a new email address, so anyone should be able to do so as well.

There's also the Core Team group, which is visible to members-only and does require approval when requesting to join, but no one has requested.

As folks join the groups with any new email addresses[1], I'll give them the same permissions they had before if I recognize who their email likely ties to, so we should be able to re-constitute the group membership. (I've already given your 2nd account ownership privileges, so you should be able to manage whichever forum that was). Once everyone who cares is re-populated, we can clean up accounts and names so everyone doesn't have a 2 after their name ;-)

There's also Gitter if more real-time conversation is useful, though for something like time and macros which can be quite complex, something a bit more long-form is probably useful.

[1]: I recommend using personal accounts for this reason... work contacts are efemeral

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.

4 participants