codeant-ai-for-open-source[bot] commented on code in PR #35825:
URL: https://github.com/apache/superset/pull/35825#discussion_r2592330218
##########
docs/docs/configuration/async-queries-celery.mdx:
##########
@@ -69,6 +70,26 @@ RESULTS_BACKEND = S3Cache(S3_CACHE_BUCKET,
S3_CACHE_KEY_PREFIX)
from flask_caching.backends.rediscache import RedisCache
RESULTS_BACKEND = RedisCache(
host='localhost', port=6379, key_prefix='superset_results')
+
+# On MinIO or other S3 compatible Service
+from minio_cache import MinioCacheBackend
+
+MINIO_HOST = 'localhost'
+MINIO_PORT = '9000'
+MINIO_ACCESS_KEY = 'minio'
+MINIO_SECRET_KEY = 'minio123'
+MINIO_BUCKET = 'superset'
+MINIO_SECURE = False
+
+RESULTS_BACKEND = MinioCacheBackend(
+ endpoint=MINIO_HOST + ":" + MINIO_PORT,
Review Comment:
**Suggestion:** Security issue: the example hardcodes MinIO credentials and
secret values in the documentation; this encourages insecure practice. Read
credentials from environment variables instead so example code does not contain
plaintext secrets. [security]
**Severity Level:** Critical 🚨
```suggestion
import os
from minio_cache import MinioCacheBackend
# Read MinIO configuration from environment variables to avoid hardcoding
secrets in code/examples
MINIO_HOST = os.environ.get('MINIO_HOST', 'localhost')
MINIO_PORT = os.environ.get('MINIO_PORT', '9000')
MINIO_ACCESS_KEY = os.environ.get('MINIO_ACCESS_KEY', '')
MINIO_SECRET_KEY = os.environ.get('MINIO_SECRET_KEY', '')
MINIO_BUCKET = os.environ.get('MINIO_BUCKET', 'superset')
MINIO_SECURE = os.environ.get('MINIO_SECURE', 'False').lower() in ('1',
'true', 'yes')
RESULTS_BACKEND = MinioCacheBackend(
endpoint=f"{MINIO_HOST}:{MINIO_PORT}",
```
<details>
<summary><b>Why it matters? ⭐ </b></summary>
The example in the docs includes plaintext credentials which encourages
insecure practices. Switching the example to read from environment variables
removes hardcoded secrets from the documentation and models safer configuration
patterns. This is a real security-quality improvement in the docs.
</details>
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** docs/docs/configuration/async-queries-celery.mdx
**Line:** 75:85
**Comment:**
*Security: Security issue: the example hardcodes MinIO credentials and
secret values in the documentation; this encourages insecure practice. Read
credentials from environment variables instead so example code does not contain
plaintext secrets.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
```
</details>
##########
docs/docs/configuration/async-queries-celery.mdx:
##########
@@ -89,6 +110,14 @@ issues arise. Please clear your existing results cache
store when upgrading an e
- SQL Lab will _only run your queries asynchronously if_ you enable
**Asynchronous Query Execution**
in your database settings (Sources > Databases > Edit record).
+- In order to use dedicated results backend, additional python libraries must
be installed. These libraries can be installed using pip.
+ - [redis-py](https://pypi.org/project/redis/) for Redis.
+ - [pylibmc](https://pypi.org/project/pylibmc/) for memecached
+ - [s3werkzeugcache](https://pypi.python.org/pypi/s3werkzeugcache) for S3
+ - [minio-flask-cache](https://github.com/greggailly/minio-flask-cache) fir
MinIO or other S3 compatible service
Review Comment:
**Suggestion:** Typo in documentation: the word "fir" is used instead of
"for" in the minio-flask-cache bullet, which is grammatically incorrect and may
reduce clarity. [possible bug]
**Severity Level:** Critical 🚨
```suggestion
- [minio-flask-cache](https://github.com/greggailly/minio-flask-cache) for
MinIO or other S3 compatible service
```
<details>
<summary><b>Why it matters? ⭐ </b></summary>
Another simple grammar/typo fix in the docs. Correcting "fir" to "for"
improves readability and avoids minor confusion; no code changes required.
</details>
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** docs/docs/configuration/async-queries-celery.mdx
**Line:** 117:117
**Comment:**
*Possible Bug: Typo in documentation: the word "fir" is used instead of
"for" in the minio-flask-cache bullet, which is grammatically incorrect and may
reduce clarity.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
```
</details>
##########
docs/docs/configuration/async-queries-celery.mdx:
##########
@@ -89,6 +110,14 @@ issues arise. Please clear your existing results cache
store when upgrading an e
- SQL Lab will _only run your queries asynchronously if_ you enable
**Asynchronous Query Execution**
in your database settings (Sources > Databases > Edit record).
+- In order to use dedicated results backend, additional python libraries must
be installed. These libraries can be installed using pip.
+ - [redis-py](https://pypi.org/project/redis/) for Redis.
+ - [pylibmc](https://pypi.org/project/pylibmc/) for memecached
Review Comment:
**Suggestion:** Typo in documentation: the word "memecached" is misspelled
and should be "memcached", which is confusing and may mislead readers
installing or searching for the correct package. [possible bug]
**Severity Level:** Critical 🚨
```suggestion
- [pylibmc](https://pypi.org/project/pylibmc/) for memcached
```
<details>
<summary><b>Why it matters? ⭐ </b></summary>
This is a straightforward documentation typo that could confuse readers when
searching/installing the package. Fixing it improves clarity and avoids
misleading users; there's no behavioral or security impact.
</details>
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** docs/docs/configuration/async-queries-celery.mdx
**Line:** 115:115
**Comment:**
*Possible Bug: Typo in documentation: the word "memecached" is
misspelled and should be "memcached", which is confusing and may mislead
readers installing or searching for the correct package.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
```
</details>
##########
docs/docs/configuration/cache.mdx:
##########
@@ -34,13 +33,29 @@ FILTER_STATE_CACHE_CONFIG = {
}
```
+To configure the filter state cache using MinIO or other S3 compatible service:
+
+```python
+FILTER_STATE_CACHE_CONFIG = {
+ 'CACHE_TYPE': 'minio_cache.MinioCacheBackend'
+ 'CACHE_MINIO_ENDPOINT': 'localhost:9000'
+ 'CACHE_MINIO_ACCESS_KEY': 'minioadmin'
+ 'CACHE_MINIO_SECRET_KEY': 'minioadmin'
+ 'CACHE_MINIO_BUCKET': 'superset'
+ 'CACHE_MINIO_SECURE': False # Set to True for HTTPS,
Review Comment:
**Suggestion:** The inline comment on the `CACHE_MINIO_SECURE` line ends
with an extraneous comma and the line itself in the original snippet lacked a
trailing comma for the dict entry; remove the comma from the comment and ensure
the dict entry has a trailing comma to avoid confusion and potential syntax
issues. [possible bug]
**Severity Level:** Critical 🚨
```suggestion
'CACHE_MINIO_SECURE': False, # Set to True for HTTPS
```
<details>
<summary><b>Why it matters? ⭐ </b></summary>
The trailing comma in the comment is confusing and the dict entry itself
lacks a trailing comma. Fixing it improves readability and, when combined with
adding other missing commas, prevents syntax issues in the example.
</details>
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** docs/docs/configuration/cache.mdx
**Line:** 45:45
**Comment:**
*Possible Bug: The inline comment on the `CACHE_MINIO_SECURE` line ends
with an extraneous comma and the line itself in the original snippet lacked a
trailing comma for the dict entry; remove the comma from the comment and ensure
the dict entry has a trailing comma to avoid confusion and potential syntax
issues.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]