bito-code-review[bot] commented on code in PR #40860:
URL: https://github.com/apache/superset/pull/40860#discussion_r3376454348


##########
superset/translations/pl/LC_MESSAGES/messages.po:
##########
@@ -4797,6 +4797,9 @@ msgstr "Ustawienia bazy danych zaktualizowane"
 msgid "Database type does not support file uploads."
 msgstr "Typ bazy danych nie obsługuje przesyłania plików."
 
+msgid "Database upload file exceeds the maximum allowed size."
+msgstr ""

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Translation: Empty translation string</b></div>
   <div id="fix">
   
   The new message `msgid "Database upload file exceeds the maximum allowed 
size."` has an empty `msgstr ""`. Users will see untranslated English text 
instead of Polish.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #5256f8</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



##########
superset/translations/fi/LC_MESSAGES/messages.po:
##########
@@ -8152,6 +8152,9 @@ msgstr "Tietokannan asetukset päivitetty"
 msgid "Database type does not support file uploads."
 msgstr "Tietokantityyppi ei tue tiedostojen lataamista."
 
+msgid "Database upload file exceeds the maximum allowed size."
+msgstr ""

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Missing Finnish translation</b></div>
   <div id="fix">
   
   The new message 'Database upload file exceeds the maximum allowed size.' has 
an empty `msgstr` field. Finnish users will see the untranslated English 
message. Add a Finnish translation to complete the localization.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #5256f8</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



##########
superset/translations/ca/LC_MESSAGES/messages.po:
##########
@@ -4655,6 +4655,9 @@ msgstr "Configuració de base de dades actualitzada"
 msgid "Database type does not support file uploads."
 msgstr "El tipus de base de dades no suporta pujades de fitxers."
 
+msgid "Database upload file exceeds the maximum allowed size."
+msgstr ""

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Missing Catalan translation for error message</b></div>
   <div id="fix">
   
   The newly added message `Database upload file exceeds the maximum allowed 
size.` has an empty `msgstr`, meaning Catalan users will see untranslated 
English text. Per rule [6516], all user-facing text must have proper 
translations to support international audiences.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ```
    --- superset/translations/ca/LC_MESSAGES/messages.po (lines 4658-4659) ---
    4658: msgid "Database upload file exceeds the maximum allowed size."
    4659:-msgstr ""
    4659:+msgstr "La mida del fitxer de pujada de base de dades supera el màxim 
permès."
   ```
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #5256f8</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



##########
superset/translations/mi/LC_MESSAGES/messages.po:
##########
@@ -4584,6 +4584,9 @@ msgstr "Kua whakahouhia ngā tautuhinga pātengi raraunga"
 msgid "Database type does not support file uploads."
 msgstr "Karekau e tautoko te momo pātengi raraunga i ngā tukuake kōnae."
 
+msgid "Database upload file exceeds the maximum allowed size."
+msgstr ""

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Incomplete translation entry</b></div>
   <div id="fix">
   
   The new translation entry for 'Database upload file exceeds the maximum 
allowed size.' has an empty `msgstr`. Users with Māori locale will see the 
untranslated English message. Provide the Māori translation to complete this 
entry.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #5256f8</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



##########
superset/translations/pt/LC_MESSAGES/messages.po:
##########
@@ -4628,6 +4628,9 @@ msgstr "Não foi possível gravar a sua query"
 msgid "Database type does not support file uploads."
 msgstr "Origem de dados %(name)s já existe"
 
+msgid "Database upload file exceeds the maximum allowed size."
+msgstr ""

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Empty translation entry</b></div>
   <div id="fix">
   
   The new entry "Database upload file exceeds the maximum allowed size." has 
an empty msgstr. Portuguese users will see the untranslated English message.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ```
    --- a/superset/translations/pt/LC_MESSAGES/messages.po
    +++ b/superset/translations/pt/LC_MESSAGES/messages.po
    @@ -4628,7 +4628,7 @@ msgstr "Origem de dados %(name)s já existe"
    
     msgid "Database upload file exceeds the maximum allowed size."
    -msgstr ""
    +msgstr "O ficheiro carregado excede o tamanho máximo permitido."
    
     #, fuzzy
     msgid "Database upload file failed"
   ```
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #5256f8</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



##########
superset/translations/de/LC_MESSAGES/messages.po:
##########
@@ -4723,6 +4723,9 @@ msgstr "Datenbankeinstellungen aktualisiert"
 msgid "Database type does not support file uploads."
 msgstr "Der Datenbanktyp unterstützt keine Datei-Uploads."
 
+msgid "Database upload file exceeds the maximum allowed size."
+msgstr ""

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Missing German translation</b></div>
   <div id="fix">
   
   The new translation entry for 'Database upload file exceeds the maximum 
allowed size.' has an empty `msgstr`. German users will see the untranslated 
English text when `DatabaseUploadFileTooLarge` exception is raised in 
`superset/commands/database/exceptions.py:123`. Provide a German translation.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ```
    --- a/superset/translations/de/LC_MESSAGES/messages.po
    +++ b/superset/translations/de/LC_MESSAGES/messages.po
    @@ -4724,7 +4724,7 @@ msgstr "Der Datenbanktyp unterstützt keine 
Datei-Uploads."
    
     msgid "Database upload file exceeds the maximum allowed size."
    -msgstr ""
    +msgstr "Datenbank-Upload-Datei überschreitet die maximal erlaubte Größe."
    
     msgid "Database upload file failed"
     msgstr "Datenbank-Upload fehlgeschlagen"
   ```
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #5256f8</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



##########
superset/translations/ko/LC_MESSAGES/messages.po:
##########
@@ -4542,6 +4542,9 @@ msgstr "데이터베이스를 업데이트할 수 없습니다."
 msgid "Database type does not support file uploads."
 msgstr ""
 
+msgid "Database upload file exceeds the maximum allowed size."
+msgstr ""

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Missing Korean translation</b></div>
   <div id="fix">
   
   The new translation string `Database upload file exceeds the maximum allowed 
size.` has an empty `msgstr`, so Korean users will see the English error 
message instead of Korean. Per rule 6516, all user-facing text should be 
properly localized.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #5256f8</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



##########
superset/translations/es/LC_MESSAGES/messages.po:
##########
@@ -4818,6 +4818,9 @@ msgstr "Configuración de la base de datos actualizada"
 msgid "Database type does not support file uploads."
 msgstr "El tipo de base de datos no admite subidas de archivos."
 
+msgid "Database upload file exceeds the maximum allowed size."
+msgstr ""

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Missing Spanish translation</b></div>
   <div id="fix">
   
   The new translation entry for 'Database upload file exceeds the maximum 
allowed size.' has an empty `msgstr` field. Spanish-speaking users will see the 
untranslated English text. Per rule 6516, all user-facing text should be 
properly localized.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #5256f8</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



##########
superset/translations/ru/LC_MESSAGES/messages.po:
##########
@@ -4553,6 +4553,9 @@ msgstr "Настройки базы данных обновлены"
 msgid "Database type does not support file uploads."
 msgstr "База данных не поддерживает загрузку файлов"
 
+msgid "Database upload file exceeds the maximum allowed size."
+msgstr ""

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Missing Russian translation</b></div>
   <div id="fix">
   
   The new message `Database upload file exceeds the maximum allowed size.` 
added at line 4556 has an empty `msgstr ""`. Russian users will see the English 
text instead of a translated message. Per BITO.md rule [6516], all user-facing 
text should use translation functions — the corresponding source string in 
`superset/commands/database/exceptions.py:123` correctly uses `_()`, so this 
translation entry must be filled in.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ```
    --- superset/translations/ru/LC_MESSAGES/messages.po (lines 4556-4557) ---
    4556: +msgid "Database upload file exceeds the maximum allowed size."
    4556: -msgid "Database upload file exceeds the maximum allowed size."
    4557: +msgstr "Загружаемый файл базы данных превышает максимально 
допустимый размер."
    4557: -msgstr ""
   ```
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #5256f8</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



##########
superset/translations/uk/LC_MESSAGES/messages.po:
##########
@@ -4543,6 +4543,9 @@ msgstr "Параметри бази даних оновлено"
 msgid "Database type does not support file uploads."
 msgstr "База даних не підтримує підвантаження файлів."
 
+msgid "Database upload file exceeds the maximum allowed size."
+msgstr ""
+

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Missing Ukrainian translation</b></div>
   <div id="fix">
   
   Ukrainian users will see an untranslated error message when a database 
upload exceeds the configured size limit (`DatabaseUploadFileTooLarge`). The 
`msgstr` must be filled in to display localized text. Other languages in this 
repo already have translations for this string.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ```
    --- a/superset/translations/uk/LC_MESSAGES/messages.po
    +++ b/superset/translations/uk/LC_MESSAGES/messages.po
    @@ -4544,7 +4544,7 @@ msgstr "База даних не підтримує підвантаження файлів."
    
     msgid "Database upload file exceeds the maximum allowed size."
    -msgstr ""
    +msgstr "Завантажений файл бази даних перевищує максимально дозволений 
розмір."
    
     msgid "Database upload file failed"
     msgstr "Не вдалося вивантажити файл до бази даних"
   ```
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #5256f8</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



##########
superset/databases/api.py:
##########
@@ -1726,6 +1726,7 @@ def upload_metadata(self) -> Response:
             parameters = UploadFileMetadataPostSchema().load(request_form)
         except ValidationError as error:
             return self.response_400(message=error.messages)
+        UploadCommand.validate_file_size(parameters["file"])

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Missing exception handler for file size 
validation</b></div>
   <div id="fix">
   
   The `DatabaseUploadFileTooLarge` exception raised here inherits from 
`CommandException` and carries `status = 413`, but the `upload_metadata` 
endpoint (unlike most other endpoints in this file) lacks the 
`@handle_api_exception` decorator. Without explicit handling, the app-level 
fallback handler catches `CommandException` and returns HTTP 500 regardless of 
the exception's `status` attribute. This means oversized-file requests get a 
500 response instead of 413. Wrap this call in a try/except that catches 
`DatabaseUploadFileTooLarge` and calls `self.response_413(...)` to return the 
correct status code.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ```
    --- a/superset/databases/api.py
    +++ b/superset/databases/api.py
    @@ -1726,6 +1726,10 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
                 parameters = UploadFileMetadataPostSchema().load(request_form)
             except ValidationError as error:
                 return self.response_400(message=error.messages)
    +        try:
    +            UploadCommand.validate_file_size(parameters["file"])
    +        except DatabaseUploadFileTooLarge as error:
    +            return self.response_413(message=error.message)
             if parameters["type"] == UploadFileType.CSV.value:
                 metadata = 
CSVReader(parameters).file_metadata(parameters["file"])
             elif parameters["type"] == UploadFileType.EXCEL.value:
   ```
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #5256f8</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



##########
superset/translations/sl/LC_MESSAGES/messages.po:
##########
@@ -4654,6 +4654,9 @@ msgstr "Nastavitve podatkovne baze posodobljene"
 msgid "Database type does not support file uploads."
 msgstr "Tip podatkovne baze ne podpira nalaganje datotek."
 
+msgid "Database upload file exceeds the maximum allowed size."
+msgstr ""

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Missing translation for new message</b></div>
   <div id="fix">
   
   The new message `Database upload file exceeds the maximum allowed size.` has 
an empty `msgstr`. Slovenian users will see untranslated English text. This 
message is used in `superset/commands/database/exceptions.py:123` and appears 
in all other translation files with empty strings as well.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #5256f8</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



-- 
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]

Reply via email to