diff --git a/.github/ISSUE_TEMPLATE/0_new_bigfunction.yaml b/.github/ISSUE_TEMPLATE/0_new_bigfunction.yaml index 25fa8d05..4eb92a97 100644 --- a/.github/ISSUE_TEMPLATE/0_new_bigfunction.yaml +++ b/.github/ISSUE_TEMPLATE/0_new_bigfunction.yaml @@ -6,14 +6,14 @@ body: - type: markdown attributes: value: | - ## π Thanks for taking the time to suggest a new BigFunction! - + ## π Thanks for taking the time to suggest a new BigFunction! + Please fill the below fields to submit your idea. - type: checkboxes id: idea_does_not_exist attributes: label: Check the idea has not already been suggested - description: Check in [existing issues](https://github.com/unytics/bigfunctions/issues?q=is%3Aissue+is%3Aopen+label%3Anew-bigfunction) if your idea has not already been suggested. If it has, please don't create a new issue but add a comment on the existing one such as `+1` to upvote it. + description: Check in [existing issues](https://github.com/unytics/bigfunctions/issues?q=is%3Aissue+is%3Aopen+label%3Anew-bigfunction) if your idea has not already been suggested. If it has, please don't create a new issue but add a comment on the existing one such as `+1` to upvote it. options: - label: I could not find my idea in [existing issues](https://github.com/unytics/bigfunctions/issues?q=is%3Aissue+is%3Aopen+label%3Anew-bigfunction) required: true diff --git a/.github/ISSUE_TEMPLATE/1_bug_bigfunction.yaml b/.github/ISSUE_TEMPLATE/1_bug_bigfunction.yaml index 20fc9ac4..feb1dba5 100644 --- a/.github/ISSUE_TEMPLATE/1_bug_bigfunction.yaml +++ b/.github/ISSUE_TEMPLATE/1_bug_bigfunction.yaml @@ -6,14 +6,14 @@ body: - type: markdown attributes: value: | - ## π Thanks for taking the time to report a bug in a BigFunction! - + ## π Thanks for taking the time to report a bug in a BigFunction! + Please fill the below fields to submit it. - type: checkboxes id: idea_does_not_exist attributes: label: Check the bug has not already been reported - description: Check in [existing issues](https://github.com/unytics/bigfunctions/issues?q=is%3Aissue+is%3Aopen+label%3Abug-bigfunction) if your idea has not already been suggested. If it has, please don't create a new issue but add a comment on the existing one such as `+1` to upvote it. + description: Check in [existing issues](https://github.com/unytics/bigfunctions/issues?q=is%3Aissue+is%3Aopen+label%3Abug-bigfunction) if your idea has not already been suggested. If it has, please don't create a new issue but add a comment on the existing one such as `+1` to upvote it. options: - label: I could not find the bug in [existing issues](https://github.com/unytics/bigfunctions/issues?q=is%3Aissue+is%3Aopen+label%3Abug-bigfunction) required: true @@ -21,7 +21,7 @@ body: id: title_is_ok attributes: label: Edit `function_name` and the short error description in title above - description: Edit the `function_name` and the short error description in the issue title above. + description: Edit the `function_name` and the short error description in the issue title above. options: - label: I wrote the correct function name and a short error description in the title above required: true diff --git a/.github/ISSUE_TEMPLATE/2_improve_bigfunction.yaml b/.github/ISSUE_TEMPLATE/2_improve_bigfunction.yaml index fc593a8b..f3e7026c 100644 --- a/.github/ISSUE_TEMPLATE/2_improve_bigfunction.yaml +++ b/.github/ISSUE_TEMPLATE/2_improve_bigfunction.yaml @@ -6,14 +6,14 @@ body: - type: markdown attributes: value: | - ## π Thanks for taking the time to help us improve! - + ## π Thanks for taking the time to help us improve! + Please fill the below fields to submit it. - type: checkboxes id: idea_does_not_exist attributes: label: Check your idea has not already been reported - description: Check in [existing issues](https://github.com/unytics/bigfunctions/issues?q=is%3Aissue+is%3Aopen+label%3Abug-bigfunction) if your idea has not already been suggested. If it has, please don't create a new issue but add a comment on the existing one such as `+1` to upvote it. + description: Check in [existing issues](https://github.com/unytics/bigfunctions/issues?q=is%3Aissue+is%3Aopen+label%3Abug-bigfunction) if your idea has not already been suggested. If it has, please don't create a new issue but add a comment on the existing one such as `+1` to upvote it. options: - label: I could not find the idea in [existing issues](https://github.com/unytics/bigfunctions/issues?q=is%3Aissue+is%3Aopen+label%3Abug-bigfunction) required: true @@ -21,7 +21,7 @@ body: id: title_is_ok attributes: label: Edit `function_name` and the short idea description in title above - description: Edit the `function_name` and the short idea description in the issue title above. + description: Edit the `function_name` and the short idea description in the issue title above. options: - label: I wrote the correct function name and a short idea description in the title above required: true diff --git a/.github/ISSUE_TEMPLATE/3_bug_bigfun_cli.yaml b/.github/ISSUE_TEMPLATE/3_bug_bigfun_cli.yaml index 77b6bfe7..36cadab0 100644 --- a/.github/ISSUE_TEMPLATE/3_bug_bigfun_cli.yaml +++ b/.github/ISSUE_TEMPLATE/3_bug_bigfun_cli.yaml @@ -6,14 +6,14 @@ body: - type: markdown attributes: value: | - ## π Thanks for taking the time to report a bug of `bigfun` Command-Line-Interface! - + ## π Thanks for taking the time to report a bug of `bigfun` Command-Line-Interface! + Please fill the below fields to submit it. - type: checkboxes id: idea_does_not_exist attributes: label: Check the bug has not already been reported - description: Check in [existing issues](https://github.com/unytics/bigfunctions/issues?q=is%3Aissue+is%3Aopen+label%3Abug-bigfun-CLI) if your idea has not already been suggested. If it has, please don't create a new issue but add a comment on the existing one such as `+1` to upvote it. + description: Check in [existing issues](https://github.com/unytics/bigfunctions/issues?q=is%3Aissue+is%3Aopen+label%3Abug-bigfun-CLI) if your idea has not already been suggested. If it has, please don't create a new issue but add a comment on the existing one such as `+1` to upvote it. options: - label: I could not find the bug in [existing issues](https://github.com/unytics/bigfunctions/issues?q=is%3Aissue+is%3Aopen+label%3Abug-bigfun-CLI) required: true diff --git a/.github/ISSUE_TEMPLATE/4_improve_bigfun_cli.yaml b/.github/ISSUE_TEMPLATE/4_improve_bigfun_cli.yaml index 418fc22f..4f3f2cff 100644 --- a/.github/ISSUE_TEMPLATE/4_improve_bigfun_cli.yaml +++ b/.github/ISSUE_TEMPLATE/4_improve_bigfun_cli.yaml @@ -7,13 +7,13 @@ body: attributes: value: | ## π Thanks for taking the time to help us improve! - + Please fill the below fields to submit your idea. - type: checkboxes id: idea_does_not_exist attributes: label: Check your idea has not already been reported - description: Check in [existing issues](https://github.com/unytics/bigfunctions/issues?q=is%3Aissue+is%3Aopen+label%3Aimprove-bigfun-CLI) if your idea has not already been suggested. If it has, please don't create a new issue but add a comment on the existing one such as `+1` to upvote it. + description: Check in [existing issues](https://github.com/unytics/bigfunctions/issues?q=is%3Aissue+is%3Aopen+label%3Aimprove-bigfun-CLI) if your idea has not already been suggested. If it has, please don't create a new issue but add a comment on the existing one such as `+1` to upvote it. options: - label: I could not find the idea in [existing issues](https://github.com/unytics/bigfunctions/issues?q=is%3Aissue+is%3Aopen+label%3Aimprove-bigfun-CLI) required: true diff --git a/.github/workflows/deploy_pages.yml b/.github/workflows/deploy_pages.yml index 94c36e0e..69b70e18 100644 --- a/.github/workflows/deploy_pages.yml +++ b/.github/workflows/deploy_pages.yml @@ -8,8 +8,8 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: 3.x - run: pip install -e . diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..184cec8a --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,24 @@ +name: lint + +on: + pull_request: + push: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + - name: Install dependencies + run: | + pip install -e .[dev] + - name: Run pre-commit + run: | + pre-commit run --all-files diff --git a/.gitignore b/.gitignore index 6337186d..801a9af0 100644 --- a/.gitignore +++ b/.gitignore @@ -144,4 +144,4 @@ site/ TEST venv -.venv/ \ No newline at end of file +.venv/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..746d903b --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,43 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: end-of-file-fixer + - id: trailing-whitespace + - id: check-json + - id: check-toml + - id: check-yaml + - id: detect-private-key + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.10.0 + hooks: + - id: mypy + additional_dependencies: + - types-PyYAML + - repo: https://github.com/rhysd/actionlint + rev: v1.7.1 + hooks: + - id: actionlint-docker + # TODO enable the hook + # - repo: https://github.com/PyCQA/bandit + # rev: 1.7.9 + # hooks: + # - id: bandit + # name: bandit (python) + # args: [--configfile, bandit.yaml, --severity-level, all] + # additional_dependencies: [bandit] + - repo: https://github.com/pycqa/isort + rev: 5.13.2 + hooks: + - id: isort + name: isort (python) + - repo: https://github.com/adrienverge/yamllint.git + rev: v1.35.1 + hooks: + - id: yamllint + args: [--strict, -c=.yamllint] + # TODO enable the hook + # - repo: https://github.com/hadolint/hadolint + # rev: v2.13.0-beta + # hooks: + # - id: hadolint-docker diff --git a/.yamllint b/.yamllint new file mode 100644 index 00000000..44c09792 --- /dev/null +++ b/.yamllint @@ -0,0 +1,10 @@ +--- +rules: + trailing-spaces: disable + key-duplicates: {} + colons: + max-spaces-before: 0 + max-spaces-after: 1 + indentation: + spaces: 2 + check-multi-line-strings: false diff --git a/README.md b/README.md index 1fe13f3f..d137482a 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,7 @@ Commands: ### 5.3 Create you first function π· -Functions are defined as yaml files under `bigfunctions` folder. To create your first function locally, the easiest is to download an existing yaml file of unytics/bigfunctions Github repo. +Functions are defined as yaml files under `bigfunctions` folder. To create your first function locally, the easiest is to download an existing yaml file of unytics/bigfunctions Github repo. For instance to download `is_email_valid.yaml` into bigfunctions folder, do: @@ -229,4 +229,3 @@ BigFunctions is fully open-source. Any contribution is more than welcome π€! - diff --git a/bandit.yaml b/bandit.yaml new file mode 100644 index 00000000..8cbd6620 --- /dev/null +++ b/bandit.yaml @@ -0,0 +1,6 @@ +# SEE https://bandit.readthedocs.io/en/latest/config.html +exclude_dirs: + - "tests" +skips: + # hardcoded_sql_expressions + - "B608" diff --git a/bigfun/bigfunctions.py b/bigfun/bigfunctions.py index 5a740b57..15fe3b44 100644 --- a/bigfun/bigfunctions.py +++ b/bigfun/bigfunctions.py @@ -1,14 +1,16 @@ -import tempfile -import re +import functools +import json import os +import re import shutil -import json -import functools +import tempfile -import yaml import jinja2 +import yaml -from .utils import BigQuery, CloudRun, handle_error, print_success, print_info, print_command, build_and_upload_npm_package, merge_dict +from .utils import (BigQuery, CloudRun, build_and_upload_npm_package, + handle_error, merge_dict, print_command, print_info, + print_success) BIGFUNCTIONS_FOLDER = 'bigfunctions' DEFAULT_CONFIG_FILENAME = './config.yaml' diff --git a/bigfun/cli.py b/bigfun/cli.py index d881e43a..9aff8df5 100644 --- a/bigfun/cli.py +++ b/bigfun/cli.py @@ -1,31 +1,34 @@ +import multiprocessing import os import shutil -import multiprocessing +import click import jinja2 import yaml -import click from click_help_colors import HelpColorsGroup -from watchdog.observers import Observer from watchdog.events import RegexMatchingEventHandler +from watchdog.observers import Observer from . import bigfunctions as bf from . import utils - TABLES_FOLDER = 'data' THIS_FOLDER = os.path.dirname(os.path.realpath(__file__)).replace('\\', '/') WEBSITE_CONFIG_FOLDER = THIS_FOLDER + '/website' CATEGORIES_DOC_TEMPLATE_FILENAME = f'{THIS_FOLDER}/templates/categories.md' -CONFIG_FILENAME = 'config.yaml' -CONFIG = {} -if os.path.exists(CONFIG_FILENAME): - CONFIG = yaml.safe_load(open(CONFIG_FILENAME, encoding='utf-8').read()) or {} +CONFIGS = {} +def get_config_value(name, config_filename): + if config_filename not in CONFIGS: + if os.path.exists(config_filename): + with open(config_filename, encoding='utf-8') as file: + CONFIGS[config_filename] = yaml.safe_load(file) or {} + else: + CONFIGS[config_filename] = {} -def get_config_value(name): - if name in CONFIG: - return CONFIG[name] + config = CONFIGS[config_filename] + if name in config: + return config[name] text, default = { 'project': ("Default GCP project where to deploy bigfunctions", None), @@ -33,10 +36,10 @@ def get_config_value(name): 'project_for_tests': ("Default GCP project where to deploy bigfunctions for TESTING purposes", None), 'dataset_for_tests': ("Default dataset where to deploy bigfunctions for TESTING purposes", None), # eu,us,asia_east1,asia_east2,asia_northeast1,asia_northeast2,asia_northeast3,asia_south1,asia_southeast1,australia_southeast1,europe_north1,europe_west1,europe_west2,europe_west3,europe_west4,europe_west6,northamerica_northeast1,southamerica_east1,us_central1,us_east1,us_east4,us_west1,us_west2 }[name] - CONFIG[name] = click.prompt(text, default=default) - with open(CONFIG_FILENAME, 'w', encoding='utf-8') as outfile: - yaml.dump(CONFIG, outfile, default_flow_style=False) - return CONFIG[name] + config[name] = click.prompt(text, default=default) + with open(config_filename, 'w', encoding='utf-8') as outfile: + yaml.dump(config, outfile, default_flow_style=False) + return config[name] def generate_doc(project, dataset): @@ -108,9 +111,9 @@ def cli(): @cli.command() @click.argument('bigfunction') def get(bigfunction): - ''' + """ Download BIGFUNCTION yaml file from unytics/bigfunctions github repo - ''' + """ if not os.path.isdir('bigfunctions'): os.makedirs('bigfunctions') url = f'https://raw.githubusercontent.com/unytics/bigfunctions/main/bigfunctions/{bigfunction}.yaml' @@ -122,12 +125,13 @@ def get(bigfunction): @cli.command() @click.argument('bigfunction') -def test(bigfunction): - ''' +@click.option('--config', default='config.yaml', help='Path to the config file') +def test(bigfunction, config): + """ Test BIGFUNCTION - ''' - project = get_config_value('project_for_tests') - dataset = get_config_value('dataset_for_tests') + """ + project = get_config_value('project_for_tests', config) + dataset = get_config_value('dataset_for_tests', config) bigfunction = bf.BigFunction(bigfunction, project=project, dataset=dataset) bigfunction.test() @@ -136,14 +140,15 @@ def test(bigfunction): @click.argument('bigfunction') @click.option('--project', help='Google Cloud project where the function will be deployed') @click.option('--dataset', help='BigQuery dataset name where the function will be deployed') -def deploy(bigfunction, project, dataset): - ''' +@click.option('--config', default='config.yaml', help='Path to the config file') +def deploy(bigfunction, project, dataset, config): + """ Deploy BIGFUNCTION Deploy the function defined in `bigfunctions/{BIGFUNCTION}.yaml` file. If BIGFUNCTION = 'ALL' then all bigfunctions contained in bigfunctions folder are deployed. - ''' - project = project or get_config_value('project') - dataset = dataset or get_config_value('dataset') + """ + project = project or get_config_value('project', config) + dataset = dataset or get_config_value('dataset', config) datasets = [dataset.strip() for dataset in dataset.split(',')] bigfunctions = [bigfunction.strip() for bigfunction in bigfunction.split(',')] if bigfunction == 'ALL': @@ -163,19 +168,19 @@ def deploy(bigfunction, project, dataset): ) - @cli.command() @click.argument('table') @click.option('--project', help='Google Cloud project where the table is created') @click.option('--dataset', help='BigQuery dataset name where the table is created') -def load_table(table, project, dataset): - ''' +@click.option('--config', default='config.yaml', help='Path to the config file') +def load_table(table, project, dataset, config): + """ Create or replace bigquery table TABLE with data contained in `data/{TABLE}.csv`. If TABLE=ALL, then all tables defined in `data` folder are created. - ''' + """ from .load_table import load_table as upload_table - project = project or get_config_value('project') - dataset = dataset or get_config_value('dataset') + project = project or get_config_value('project', config) + dataset = dataset or get_config_value('dataset', config) datasets = [dataset.strip() for dataset in dataset.split(',')] if table == 'ALL': tables = [f.replace('.yaml', '') for f in os.listdir(TABLES_FOLDER) if f.endswith('.yaml')] @@ -191,35 +196,36 @@ def load_table(table, project, dataset): @cli.group() def docs(): - ''' + """ Generate, serve and publish documentation - ''' + """ pass @docs.command() @click.option('--project', help='Google Cloud project where the table is created') @click.option('--dataset', help='BigQuery dataset name where the table is created') -def generate(project, dataset): - ''' +@click.option('--config', default='config.yaml', help='Path to the config file') +def generate(project, dataset, config): + """ Generate markdown files for documentation from yaml bigfunctions files - ''' - project = project or get_config_value('project') - dataset = dataset or get_config_value('dataset') + """ + project = project or get_config_value('project', config) + dataset = dataset or get_config_value('dataset', config) generate_doc(project, dataset) os.system('mkdocs build') - @docs.command() @click.option('--project', help='Google Cloud project where the table is created') @click.option('--dataset', help='BigQuery dataset name where the table is created') -def serve(project, dataset): - ''' +@click.option('--config', default='config.yaml', help='Path to the config file') +def serve(project, dataset, config): + """ Serve docs locally on http://localhost:8000 - ''' - project = project or get_config_value('project') - dataset = dataset or get_config_value('dataset') + """ + project = project or get_config_value('project', config) + dataset = dataset or get_config_value('dataset', config) generate_doc(project, dataset) class EventHandler(RegexMatchingEventHandler): @@ -232,3 +238,4 @@ def on_any_event(self, event): # observer.start() # bf.generate_doc(project, dataset) os.system('mkdocs serve') + diff --git a/bigfun/datastore/index.yaml b/bigfun/datastore/index.yaml index bc37fb50..2ce19f82 100644 --- a/bigfun/datastore/index.yaml +++ b/bigfun/datastore/index.yaml @@ -1,7 +1,5 @@ indexes: - -- kind: bigfunction_call - properties: - - name: user_bigfunction_date - - name: row_count - + - kind: bigfunction_call + properties: + - name: user_bigfunction_date + - name: row_count diff --git a/bigfun/load_table.py b/bigfun/load_table.py index 198776c8..5ed5f603 100644 --- a/bigfun/load_table.py +++ b/bigfun/load_table.py @@ -22,4 +22,3 @@ def load_table(table): job_config = google.cloud.bigquery.job.LoadJobConfig(**load_config) bigquery.load_table_from_file(file, table, job_config=job_config).result() print_success('successfully loaded ' + table) - diff --git a/bigfun/templates/bookmarklet.js b/bigfun/templates/bookmarklet.js index 224de348..dc74451b 100644 --- a/bigfun/templates/bookmarklet.js +++ b/bigfun/templates/bookmarklet.js @@ -121,7 +121,3 @@ loadFunnelGraphJs(); loadChartJs(); loadGoogleChart(); setInterval(run, 100); - - - - diff --git a/bigfun/templates/categories.md b/bigfun/templates/categories.md index c0fcd755..9ebc2eaf 100644 --- a/bigfun/templates/categories.md +++ b/bigfun/templates/categories.md @@ -45,4 +45,3 @@ BigFunctions are open-source BigQuery routines that give you **SQL-superpowers** {% endfor %} {% endfor %} - diff --git a/bigfun/templates/function_py.py b/bigfun/templates/function_py.py index 3b28e173..a07719ac 100644 --- a/bigfun/templates/function_py.py +++ b/bigfun/templates/function_py.py @@ -1,14 +1,13 @@ -import time import re -import json import datetime +import json +import time import traceback import uuid -from flask import Flask, request, jsonify import google.auth import google.cloud.error_reporting - +from flask import Flask, jsonify, request error_reporter = google.cloud.error_reporting.Client() app = Flask(__name__) diff --git a/bigfun/templates/function_py.sql b/bigfun/templates/function_py.sql index effbcb0c..e2f51507 100644 --- a/bigfun/templates/function_py.sql +++ b/bigfun/templates/function_py.sql @@ -5,4 +5,4 @@ options ( endpoint = '{{ remote_endpoint }}', user_defined_context = [("dataset_location", "{{ dataset_location }}")] {% if max_batching_rows %}, max_batching_rows = {{ max_batching_rows }}{% endif %} -); \ No newline at end of file +); diff --git a/bigfun/templates/function_py_test.py b/bigfun/templates/function_py_test.py index 7722b200..ec9df754 100644 --- a/bigfun/templates/function_py_test.py +++ b/bigfun/templates/function_py_test.py @@ -13,4 +13,4 @@ def run(): {{ code | indent(4) }} result = run() -print(result) \ No newline at end of file +print(result) diff --git a/bigfun/templates/procedure_test.sql b/bigfun/templates/procedure_test.sql index 5709e768..f0c401db 100644 --- a/bigfun/templates/procedure_test.sql +++ b/bigfun/templates/procedure_test.sql @@ -1,3 +1,3 @@ {% if bigfunction.type == 'procedure' %}call{% elif bigfunction.type == 'table_function' %}select * from{% else %}select{% endif %} {{ dataset }}.{{ bigfunction.name }}({% for argument in example.arguments %}{{ argument | replace('{BIGFUNCTIONS_DATASET}', dataset) | replace('\n', '\n ') }}{% if not loop.last %}, {% endif %}{% endfor %}){% if bigfunction.type == 'procedure' %};{% elif 'output' in bigfunction and bigfunction.type != 'table_function' %} as {{ bigfunction.output.name }}{% endif %} {% if bigfunction.type == 'procedure' and bigfunction.template %}select html from bigfunction_result;{% endif %} -{%- if bigfunction.type == 'procedure' and example.output %}select * from bigfunction_result;{% endif %} \ No newline at end of file +{%- if bigfunction.type == 'procedure' and example.output %}select * from bigfunction_result;{% endif %} diff --git a/bigfun/utils.py b/bigfun/utils.py index 9b18d225..5d915343 100644 --- a/bigfun/utils.py +++ b/bigfun/utils.py @@ -1,20 +1,18 @@ -import tempfile -import shutil +import math import os -import sys +import shutil import subprocess -import math +import sys +import tempfile import urllib.request - +import click import google.api_core.exceptions import google.auth.exceptions import google.cloud.bigquery import google.cloud.bigquery_connection_v1 import google.cloud.storage import google.iam.v1.policy_pb2 -import click - def print_color(msg): @@ -366,4 +364,4 @@ def download(url, destination_filename): try: urllib.request.urlretrieve(url, destination_filename) except Exception as e: - handle_error(f'Could not download file at url `{url}`. Reason: {e}') \ No newline at end of file + handle_error(f'Could not download file at url `{url}`. Reason: {e}') diff --git a/bigfun/website/theme_overrides/main.html b/bigfun/website/theme_overrides/main.html index 539c0399..681f76e3 100644 --- a/bigfun/website/theme_overrides/main.html +++ b/bigfun/website/theme_overrides/main.html @@ -225,7 +225,3 @@
timestamp_from_unix_date_time(unix_date_time, date_time_part)
](timestamp_from_unix_date_time.md): Interprets `unix_date_time` as the number of `date_time_part` since `1970-01-01 00:00:00 UTC`.
- [timestamp_to_unix_date_time(timestamp_expression, date_time_part)
](timestamp_to_unix_date_time.md): Returns the number of `date_time_part` since `1970-01-01 00:00:00 UTC`.
- [upsert(query_or_table_or_view, destination_table, insertion_mode, primary_keys, recency_field)
](upsert.md): Merges `query_or_table_or_view` into the `destination_table`.
-
-
-
diff --git a/bigfunctions/ask_ai.yaml b/bigfunctions/ask_ai.yaml
index 239f63a7..1d4c45e9 100644
--- a/bigfunctions/ask_ai.yaml
+++ b/bigfunctions/ask_ai.yaml
@@ -102,4 +102,3 @@ requirements: |
quotas:
max_rows_per_user_per_day: 1000
max_rows_per_query: 10
-
diff --git a/bigfunctions/deduplicate_rows.yaml b/bigfunctions/deduplicate_rows.yaml
index ae860dc7..a3b1438b 100644
--- a/bigfunctions/deduplicate_rows.yaml
+++ b/bigfunctions/deduplicate_rows.yaml
@@ -15,7 +15,7 @@ examples:
- description: "Returns table with duplicate rows removed."
arguments:
- '"my_project.my_dataset.my_table"'
- output: |
+ output: |
+-----+-----+
| id1 | id2 |
+-----+-----+
diff --git a/bigfunctions/deidentify.yaml b/bigfunctions/deidentify.yaml
index 4bcd8e48..fd5b6b9b 100644
--- a/bigfunctions/deidentify.yaml
+++ b/bigfunctions/deidentify.yaml
@@ -88,4 +88,4 @@ code: |
requirements: |
google-cloud-dlp
quotas:
- max_rows_per_user_per_day: 10000
\ No newline at end of file
+ max_rows_per_user_per_day: 10000
diff --git a/bigfunctions/detect_sensitive_info.yaml b/bigfunctions/detect_sensitive_info.yaml
index ab45eb46..5d587749 100644
--- a/bigfunctions/detect_sensitive_info.yaml
+++ b/bigfunctions/detect_sensitive_info.yaml
@@ -67,4 +67,4 @@ code: |
]
return json.dumps(results, ensure_ascii=False) if results else None
requirements: |
- google-cloud-dlp
\ No newline at end of file
+ google-cloud-dlp
diff --git a/bigfunctions/exchange_rate.yaml b/bigfunctions/exchange_rate.yaml
index 0b2a228c..6cde3080 100644
--- a/bigfunctions/exchange_rate.yaml
+++ b/bigfunctions/exchange_rate.yaml
@@ -57,4 +57,4 @@ code: |
requirements: |
yfinance
cloud_run:
- max_instances: 10
\ No newline at end of file
+ max_instances: 10
diff --git a/bigfunctions/explore_column.yaml b/bigfunctions/explore_column.yaml
index 000d8b10..8599a7f3 100644
--- a/bigfunctions/explore_column.yaml
+++ b/bigfunctions/explore_column.yaml
@@ -226,4 +226,3 @@ template: |
-
diff --git a/bigfunctions/explore_dataset.yaml b/bigfunctions/explore_dataset.yaml
index 0f213c27..89cb4825 100644
--- a/bigfunctions/explore_dataset.yaml
+++ b/bigfunctions/explore_dataset.yaml
@@ -102,5 +102,3 @@ template: |-