Skip to content

Commit 3328d0a

Browse files
chalmerlowegcf-owl-bot[bot]tswast
authored
feat: remove illegal character check (#892)
* feat: remove illegal character check * more testing * more testing redux * more testing redux II * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Delete compliance_comparison_script.py inadvertently uploaded. * Delete issue_test.py inadvertently uploaded. * Delete noxfile.py.bak inadvertently uploaded. * Delete to_delete.py inadvertently uploaded. * Update sqlalchemy_bigquery/base.py * Update sqlalchemy_bigquery/base.py * Update sqlalchemy_bigquery/base.py * Update sqlalchemy_bigquery/base.py * Update sqlalchemy_bigquery/base.py * Update sqlalchemy_bigquery/base.py * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Update sqlalchemy_bigquery/base.py * Update sqlalchemy_bigquery/base.py * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Update sqlalchemy_bigquery/base.py Co-authored-by: Tim Swast <[email protected]> * Update sqlalchemy_bigquery/base.py * updates illegal character check, removing backtick --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Tim Swast <[email protected]>
1 parent 47fede1 commit 3328d0a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

sqlalchemy_bigquery/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@
5656
from .parse_url import parse_url
5757
from . import _helpers, _struct, _types
5858

59-
FIELD_ILLEGAL_CHARACTERS = re.compile(r"[^\w]+")
59+
# Illegal characters is intended to be all characters that are not explicitly
60+
# allowed as part of the flexible column names.
61+
# https://cloud.google.com/bigquery/docs/schemas#flexible-column-names
62+
FIELD_ILLEGAL_CHARACTERS = re.compile(r'[!"$()*,./;?@[\\\]^{}~\n]+', re.ASCII)
6063

6164
TABLE_VALUED_ALIAS_ALIASES = "bigquery_table_valued_alias_aliases"
6265

tests/system/test_sqlalchemy_bigquery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ def test_labels(session, table, session_using_test_dataset, table_using_test_dat
432432
# Valid
433433
table.c.string.label("_123abc"),
434434
# Invalid, contains illegal characters
435-
table.c.string.label("!@#$%^&*()~`"),
435+
table.c.string.label("!@$^*()\n{};/,.~abc"),
436436
)
437437
result = result.all()
438438
assert len(result) > 0

0 commit comments

Comments
 (0)