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

Fix lint, package version, and survey config #1379

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "querybook",
"version": "3.28.4",
"version": "3.29.0",
"description": "A Big Data Webapp",
"private": true,
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ def get_all_schema_names(self) -> List[str]:

def get_all_table_names_in_schema(self, schema_name: str) -> List[str]:
if self._engine.dialect.name == "bigquery":
return [table.split(".")[1] for table in self._inspect.get_table_names(schema=schema_name)]
return [
table.split(".")[1]
for table in self._inspect.get_table_names(schema=schema_name)
]
else:
return self._inspect.get_table_names(schema=schema_name)

Expand Down
12 changes: 6 additions & 6 deletions querybook/webapp/config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ declare module 'config/querybook_public_config.yaml' {
enabled: boolean;
};
};
survey: {
global_response_cooldown: number;
global_trigger_cooldown: number;
global_max_per_week: number;
global_max_per_day: number;
survey?: {
global_response_cooldown?: number;
global_trigger_cooldown?: number;
global_max_per_week?: number;
global_max_per_day?: number;

surfaces: Array<{
surfaces?: Array<{
surface: string;
response_cooldown?: number;
trigger_cooldown?: number;
Expand Down
15 changes: 10 additions & 5 deletions querybook/webapp/lib/survey/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@ import type { ISurveyConfig } from './types';
const surveyConfig = PublicConfig.survey;

export const SURVEY_CONFIG: Record<string, ISurveyConfig> = {};
surveyConfig?.surfaces.forEach((surface) => {
surveyConfig?.surfaces?.forEach((surface) => {
SURVEY_CONFIG[surface.surface] = {
surface: surface.surface,
responseCooldown:
surface.response_cooldown ?? surveyConfig.global_response_cooldown,
surface.response_cooldown ??
surveyConfig.global_response_cooldown ??
2592000, // 30 days
triggerCooldown:
surface.trigger_cooldown ?? surveyConfig.global_trigger_cooldown,
maxPerWeek: surface.max_per_week ?? surveyConfig.global_max_per_week,
maxPerDay: surface.max_per_day ?? surveyConfig.global_max_per_day,
surface.trigger_cooldown ??
surveyConfig.global_trigger_cooldown ??
600, // 10 minutes
maxPerWeek:
surface.max_per_week ?? surveyConfig.global_max_per_week ?? 3,
maxPerDay: surface.max_per_day ?? surveyConfig.global_max_per_day ?? 1,
};
});
2 changes: 1 addition & 1 deletion requirements/engine/bigquery.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
google-cloud-bigquery==3.12.0
google-cloud-bigquery-storage==2.22.0
pyarrow==13.0.0
sqlalchemy-bigquery==1.8.0
sqlalchemy-bigquery==1.8.0
Loading