Comments (1)
Hey @kidusmakonnen! I'm here to help you with any bugs, questions, or contributions you have for the repository. Let me know how I can assist you!
The error TypeError: unsupported operand type(s) for +: 'int' and 'str'
indicates that the values for table_cache_timeout
and schema_cache_timeout
are being treated as strings instead of integers. This can happen if these values are not correctly set as integers in your configuration.
To resolve this issue, ensure that the values for table_cache_timeout
and schema_cache_timeout
are set as integers. Here is how you can set these values correctly:
-
Directly in the configuration file:
# Ensure these values are set as integers table_cache_timeout = 300 # Example value in seconds schema_cache_timeout = 300 # Example value in seconds
-
Reading from environment variables:
import os # Example of reading from environment variables and converting to integers table_cache_timeout = int(os.getenv('TABLE_CACHE_TIMEOUT', 300)) schema_cache_timeout = int(os.getenv('SCHEMA_CACHE_TIMEOUT', 300))
Additionally, ensure that any cache-related functions handle the cache timeout values correctly. For example, in the set_and_log_cache
function from superset/utils/cache.py
, the cache_timeout
parameter should be an integer:
def set_and_log_cache(
cache_instance: Cache,
cache_key: str,
cache_value: dict[str, Any],
cache_timeout: int | None = None,
datasource_uid: str | None = None,
) -> None:
if isinstance(cache_instance.cache, NullCache):
return
timeout = (
cache_timeout
if cache_timeout is not None
else app.config["CACHE_DEFAULT_TIMEOUT"]
)
try:
dttm = datetime.utcnow().isoformat().split(".")[0]
value = {**cache_value, "dttm": dttm}
cache_instance.set(cache_key, value, timeout=timeout)
stats_logger.incr("set_cache_key")
if datasource_uid and config["STORE_CACHE_KEYS_IN_METADATA_DB"]:
ck = CacheKey(
cache_key=cache_key,
cache_timeout=cache_timeout,
datasource_uid=datasource_uid,
)
db.session.add(ck)
except Exception as ex: # pylint: disable=broad-except
logger.warning("Could not cache key %s", cache_key)
logger.exception(ex)
By ensuring these values are integers and correctly handled in your cache-related functions, you should be able to avoid the TypeError
and successfully fetch the schema list and table list in SQLLab [1][2].
Details
About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a ๐ if this is helpful and ๐ if it is irrelevant.
To continue the conversation, mention @dosu.
from superset.
Related Issues (20)
- Bar Chart: Bar Chart Echart X Axis and Y Axis labels not showing HOT 3
- The default URL generated by Dashboard has security risks๏ผ HOT 23
- Advanced Period filter bug HOT 2
- Switching languages doesn't take effect on some menu elements if BABEL_DEFAULT_LOCALE is not "en" HOT 13
- ENABLE_JAVASCRIPT_CONTROLS use HOT 2
- [SIP-144] Proposal to Integrate VisActor Visualization Plugin into Superset HOT 3
- Dashboard Color Scheme keeps changing every refresh HOT 5
- Bug: fetchGuestToken function is not called after internet is disconnected and error is encountered during embedded report access HOT 3
- The in-memory storage for tracking rate limits HOT 14
- Filtered values not appearing/not working after selected from dropdown Post Migration to Latest Superset Version HOT 9
- Proxy is unable to function properly HOT 8
- Importing example dataset failes because of database constraint HOT 3
- DynamoDB Chart Failure HOT 1
- Unable to create/see datasets HOT 1
- [4.1.0rc1] Building Docker image from sources fails HOT 3
- `Error: Referenced columns not available in DataFrame` in Mixed Charts when one query has only nulls HOT 1
- Inconsistencies in the handling of misspelled URLs HOT 2
- AttributeError: 'Template' object has no attribute 'strip' HOT 3
- Embedded view shows only [Error: column "string" does not exist] HOT 2
- bug when updating chart /api/v1/chart/{pk} HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from superset.