[go: nahoru, domu]

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

Adding UDF Testing Framework #36

Merged
merged 48 commits into from
Apr 7, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
d2d81c4
Adding UDF Unit Testing Framework
danieldeleo Nov 7, 2019
7ea3ae4
Adding test cases yaml files
danieldeleo Nov 7, 2019
284e61d
Adding test cases yaml files
danieldeleo Nov 7, 2019
d0b2fa6
initial commit of contributing and readme docs in udfs
tslr Nov 7, 2019
3ae2882
Merge branch 'master' of https://github.com/danieldeleo/bigquery-utils
tslr Nov 7, 2019
4217145
Adding dataset back into function name
tslr Nov 7, 2019
ba84015
Removing dataset from function name to allow deployment of UDF to a d…
danieldeleo Nov 7, 2019
c474aa3
Escaping reserved SQL keywords "left" and "right" with backticks in UDFs
danieldeleo Nov 7, 2019
d810e23
Fixing bug in nullifzero teradata function
danieldeleo Nov 7, 2019
8dfc104
Adding more test cases for int UDF
danieldeleo Nov 7, 2019
2da0dfc
Merge branch 'master' of https://github.com/danieldeleo/bigquery-utils
tslr Nov 7, 2019
b7381ee
Fixing Vertica test name
danieldeleo Nov 20, 2019
b248af9
Merge branch 'master' of https://github.com/danieldeleo/bigquery-utils
tslr Dec 2, 2019
4e86fc6
Updating dev branch to be current with master (#28)
danieldeleo Dec 2, 2019
80eca9e
Merge branch 'dev' into master
danieldeleo Dec 2, 2019
3db0744
Unify tests (#1)
danieldeleo Dec 12, 2019
3449549
Merge branch 'master' of https://github.com/GoogleCloudPlatform/bigqu…
danieldeleo Dec 13, 2019
e24cb0b
Fixes to allow calling functions within functions
danieldeleo Dec 13, 2019
b2157c7
Fixes to allow calling functions within functions
danieldeleo Dec 16, 2019
f164efd
Fixes to allow calling functions within functions
danieldeleo Dec 16, 2019
0be92a4
Fixes to allow calling functions within functions
danieldeleo Dec 16, 2019
1fc2dc1
Fixes to allow calling functions within functions
danieldeleo Dec 16, 2019
0f2cf9a
Merge remote-tracking branch 'origin/master'
tslr Dec 16, 2019
251527c
Merge branch 'master' into master
danieldeleo Dec 16, 2019
2e3e79d
Merge branch 'master' of https://github.com/danieldeleo/bigquery-utils
tslr Dec 16, 2019
67143b8
Merge remote-tracking branch 'origin/master'
tslr Dec 16, 2019
6f259d9
Updates to address code review comments
danieldeleo Jan 10, 2020
cc7a90c
Updates to address code review comments
danieldeleo Jan 13, 2020
ce87115
Merge branch 'master' of https://github.com/GoogleCloudPlatform/bigqu…
danieldeleo Jan 13, 2020
90a9078
Updates to address code review comments
danieldeleo Jan 13, 2020
f5385c6
Updates to address code review comments
danieldeleo Jan 28, 2020
84b6141
Updates to address code review comments
danieldeleo Jan 31, 2020
ad40620
Reformatting markdown
danieldeleo Feb 7, 2020
4affdcd
Merge branch 'master' of https://github.com/GoogleCloudPlatform/bigqu…
danieldeleo Feb 7, 2020
53650c9
Updates to address code review
danieldeleo Feb 8, 2020
03b3cb3
Updates to address code review
danieldeleo Feb 8, 2020
e956336
Updates to address code review
danieldeleo Feb 8, 2020
3b057d8
Updates to address code review
danieldeleo Feb 11, 2020
340d575
Updates to address code review
danieldeleo Feb 12, 2020
13da329
Updates to address code review
danieldeleo Feb 12, 2020
f1c035c
Updates to address code review
danieldeleo Feb 12, 2020
a302250
Updates to address code review
danieldeleo Feb 13, 2020
d4bf801
Updates to address code review
danieldeleo Feb 13, 2020
7b99fec
Fix mismatching function/file name and add implicit test for extract_…
danieldeleo Mar 5, 2020
cc54154
Fix mismatching function/file name and add implicit test for extract_…
danieldeleo Mar 5, 2020
7977840
Documentation clarifications
danieldeleo Mar 6, 2020
d21a74b
Adding pathlib for cleaner file handling
danieldeleo Apr 7, 2020
d2a1417
python linter and one more pathlib change
danieldeleo Apr 7, 2020
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
Prev Previous commit
Next Next commit
Updates to address code review
  • Loading branch information
danieldeleo committed Feb 8, 2020
commit e956336cd2d28fc87cb9c4b53c92daf66b99fa6b
4 changes: 2 additions & 2 deletions udfs/tests/create_udf_signatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ def test_create_udf_signature(self, udf_path):
job_config.default_dataset = (
f'{client.project}.{bq_test_dataset}'
)
udf_name = utils.extract_udf_signature(udf_path)
udf_signature = utils.extract_udf_signature(udf_path)
udf_sql = utils.replace_with_test_datasets(
project_id=client.project,
udf_sql=f'CREATE OR REPLACE FUNCTION {udf_name} AS (NULL)')
udf_sql=f'CREATE OR REPLACE FUNCTION {udf_signature} AS (NULL)')
try:
udf_creation_result = client.query(
udf_sql,
Expand Down
4 changes: 2 additions & 2 deletions udfs/tests/udf_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ def extract_udf_signature(udf_path):
with open(udf_path) as udf_file:
udf_sql = udf_file.read()
udf_sql = udf_sql.replace('\n', ' ')
pattern = re.compile(r'FUNCTION\s+(`?.+?`?.*?\)).*?\s+AS')
pattern = re.compile(r'FUNCTION\s+(`?.+?`?.*?\).*?\s+)AS')
match = pattern.search(udf_sql)
if match:
udf_name = match[1]
udf_name = match[1].replace('LANGUAGE', '').replace('js', '')
return udf_name
else:
return udf_path
Expand Down