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

feat: create table with long name #13871

Merged
merged 1 commit into from
Mar 31, 2021
Merged
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
6 changes: 6 additions & 0 deletions superset/examples/big_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
import random
import string
from typing import List

import sqlalchemy.sql.sqltypes
Expand Down Expand Up @@ -68,3 +70,7 @@ def load_big_data() -> None:
]
for i in range(1000):
add_data(columns=columns, num_rows=10, table_name=f"small_table_{i}")

print("Creating table with long name")
name = "".join(random.choices(string.ascii_letters + string.digits, k=64))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @amitmiran137 already create a get_random_string function in test utils:

def get_random_string(length):

Maybe consolidate?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's possible to import the get_random_string function here, so are you suggesting moving it outside the tests/ directory and reusing it both here and in the test?

add_data(columns=columns, num_rows=10, table_name=name)