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

ui: Disable tip for sampled queries #1471

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

zhangvi7
Copy link
Contributor

If query is already sampled, we hide the user tip

@zhangvi7 zhangvi7 self-assigned this Jun 28, 2024
@czgu
Copy link
Collaborator

czgu commented Jun 28, 2024

hey @jczhong84 and @zhangvi7 do you know why is sampling rate info piped down from composer to the execution? isn't it available via query meta? https://github.com/pinterest/querybook/pull/1465/files

@zhangvi7
Copy link
Contributor Author

zhangvi7 commented Jun 28, 2024

@czgu Its used the determine if the currently written query before executing is eligible for sampling based on tables and then decide we to show user tip
I think we can also get from execution meta table if we do not want to pass down props

@zhangvi7 zhangvi7 requested a review from jczhong84 June 28, 2024 21:02
@zhangvi7
Copy link
Contributor Author

zhangvi7 commented Jul 2, 2024

Included bug fix for query composer:

  • Previously if tables in query change, we did not update samplingTables to include updated sampleRate.
  • And execution metadata was not updated properly if there are no sampling tables

Added getter functions to provide updated values for sampleRate and samplingTables, similar to DataDocQueryCell

/>
) : null;
const tableSamplingDOM = (
// !disabled && TABLE_SAMPLING_CONFIG.enabled && hasSamplingTables ? (
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we remove those commented out lines if they are not needed

samplingTables[tableName].sample_rate = getSampleRate();
});
return samplingTables;
}, [getSampleRate, samplingTables]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

can these be accommodated into the useTableSampleRate?

@@ -38,7 +43,7 @@ export const SamplingTooltip: React.FC<SamplingTooltipProps> = ({
setShowSamplingTip(false);
};
}
}, [status, id, queryCanBeSampled, delay]);
}, [id, delay, enabled, hasSamplingTables, sampleRate, status]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is this id?

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.

None yet

3 participants