Skip to content

Commit

Permalink
fixing some pandas stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Jan 8, 2025
1 parent 1099a66 commit 46362fe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
10 changes: 5 additions & 5 deletions superset/examples/sf_population_polygons.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.

import pandas as pd
from sqlalchemy import BigInteger, Float, inspect, Text
from sqlalchemy import inspect

import superset.utils.database as database_utils
from superset import db
Expand Down Expand Up @@ -47,10 +47,10 @@ def load_sf_population_polygons(
if_exists="replace",
chunksize=500,
dtype={
"zipcode": BigInteger,
"population": BigInteger,
"contour": Text,
"area": Float,
"zipcode": int,
"population": int,
"contour": str,
"area": float,
},
index=False,
)
Expand Down
5 changes: 2 additions & 3 deletions superset/examples/world_bank.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import os

import pandas as pd
from sqlalchemy import DateTime, inspect, String
from sqlalchemy import inspect, String
from sqlalchemy.sql import column

import superset.utils.database
Expand Down Expand Up @@ -69,8 +69,7 @@ def load_world_bank_health_n_pop( # pylint: disable=too-many-locals
if_exists="replace",
chunksize=50,
dtype={
# TODO(bkyryliuk): use TIMESTAMP type for presto
"year": DateTime if database.backend != "presto" else String(255),
"year": String(255),
"country_code": String(3),
"country_name": String(255),
"region": String(255),
Expand Down
4 changes: 2 additions & 2 deletions tests/integration_tests/fixtures/world_bank_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import pandas as pd
import pytest
from pandas import DataFrame
from sqlalchemy import DateTime, String
from sqlalchemy import String

from superset import db
from superset.connectors.sqla.models import SqlaTable
Expand All @@ -47,7 +47,7 @@ def load_world_bank_data():
with app.app_context():
database = get_example_database()
dtype = {
"year": DateTime if database.backend != "presto" else String(255),
"year": String(255),
"country_code": String(3),
"country_name": String(255),
"region": String(255),
Expand Down

0 comments on commit 46362fe

Please sign in to comment.