Skip to content

Commit

Permalink
Revert "[Feature] Supports non half width alphanumeric for generic te…
Browse files Browse the repository at this point in the history
…st (#8203)" (#9048)

This reverts commit f45b013.
  • Loading branch information
colin-rogers-dbt authored Nov 9, 2023
1 parent b58e8e3 commit e24f9b3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 61 deletions.
6 changes: 0 additions & 6 deletions .changes/unreleased/Features-20230725-122847.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion core/dbt/parser/generic_test_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def synthesize_generic_test_names(

flat_args.extend([str(part) for part in parts])

clean_flat_args = [re.sub(r"\W+", "_", arg) for arg in flat_args]
clean_flat_args = [re.sub("[^0-9a-zA-Z_]+", "_", arg) for arg in flat_args]
unique = "__".join(clean_flat_args)

# for the file path + alias, the name must be <64 characters
Expand Down
50 changes: 0 additions & 50 deletions tests/adapter/dbt/tests/adapter/basic/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,6 @@
10,Nora,1976-03-01T16:51:39
""".lstrip()

seeds_jp_base_csv = """
id,名前,ふりがな,部署コード,イニシャル
1,比嘉,ひが,10000,H
2,金城,きんじょう,10000,K
3,大城,おおしろ,10001,O
4,宮城,みやぎ,10001,M
5,新垣,あらかき,10002,A
6,玉城,たましろ,10002,T
7,上原,うえはら,10002,U
8,島袋,しまぶくろ,10003,S
9,平良,たいら,10003,T
10,山城,やましろ,10003,Y
""".lstrip()


seeds_added_csv = (
seeds_base_csv
Expand Down Expand Up @@ -75,18 +61,6 @@
- name: id
tests:
- not_null
- name: 名前
tests:
- not_null
- name: ふりがな
tests:
- not_null
- name: 部署コード
tests:
- not_null
- name: イニシャル
tests:
- not_null
"""

generic_test_view_yml = """
Expand All @@ -97,18 +71,6 @@
- name: id
tests:
- not_null
- name: 名前
tests:
- not_null
- name: ふりがな
tests:
- not_null
- name: 部署コード
tests:
- not_null
- name: イニシャル
tests:
- not_null
"""

generic_test_table_yml = """
Expand All @@ -119,18 +81,6 @@
- name: id
tests:
- not_null
- name: 名前
tests:
- not_null
- name: ふりがな
tests:
- not_null
- name: 部署コード
tests:
- not_null
- name: イニシャル
tests:
- not_null
"""

test_passing_sql = """
Expand Down
8 changes: 4 additions & 4 deletions tests/adapter/dbt/tests/adapter/basic/test_generic_tests.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
from dbt.tests.util import run_dbt
from dbt.tests.adapter.basic.files import (
seeds_jp_base_csv,
seeds_base_csv,
generic_test_seed_yml,
base_view_sql,
base_table_sql,
Expand All @@ -19,7 +19,7 @@ def project_config_update(self):
@pytest.fixture(scope="class")
def seeds(self):
return {
"base.csv": seeds_jp_base_csv,
"base.csv": seeds_base_csv,
"schema.yml": generic_test_seed_yml,
}

Expand All @@ -39,15 +39,15 @@ def test_generic_tests(self, project):

# test command selecting base model
results = run_dbt(["test", "-m", "base"])
assert len(results) == 5
assert len(results) == 1

# run command
results = run_dbt(["run"])
assert len(results) == 2

# test command, all tests
results = run_dbt(["test"])
assert len(results) == 15
assert len(results) == 3


class TestGenericTests(BaseGenericTests):
Expand Down

0 comments on commit e24f9b3

Please sign in to comment.