mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
feat: improve docker-compose services boot sequence (#31747)
This commit is contained in:
committed by
GitHub
parent
5f18e849c1
commit
7bd53a84d5
@@ -14,6 +14,7 @@
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import logging
|
||||
import random
|
||||
import string
|
||||
|
||||
@@ -21,6 +22,8 @@ import sqlalchemy.sql.sqltypes
|
||||
|
||||
from superset.utils.mock_data import add_data, ColumnInfo
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
COLUMN_TYPES = [
|
||||
sqlalchemy.sql.sqltypes.INTEGER(),
|
||||
sqlalchemy.sql.sqltypes.VARCHAR(length=255),
|
||||
@@ -34,7 +37,7 @@ COLUMN_TYPES = [
|
||||
|
||||
|
||||
def load_big_data() -> None:
|
||||
print("Creating table `wide_table` with 100 columns")
|
||||
logger.debug("Creating table `wide_table` with 100 columns")
|
||||
columns: list[ColumnInfo] = []
|
||||
for i in range(100):
|
||||
column: ColumnInfo = {
|
||||
@@ -48,7 +51,7 @@ def load_big_data() -> None:
|
||||
columns.append(column)
|
||||
add_data(columns=columns, num_rows=1000, table_name="wide_table")
|
||||
|
||||
print("Creating 1000 small tables")
|
||||
logger.debug("Creating 1000 small tables")
|
||||
columns = [
|
||||
{
|
||||
"name": "id",
|
||||
@@ -70,6 +73,6 @@ 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")
|
||||
logger.debug("Creating table with long name")
|
||||
name = "".join(random.choices(string.ascii_letters + string.digits, k=60)) # noqa: S311
|
||||
add_data(columns=columns, num_rows=10, table_name=name)
|
||||
|
||||
Reference in New Issue
Block a user