before_code stringlengths 30 149k | reviewer_comment stringlengths 16 20.6k | after_code stringlengths 30 163k | diff_context stringlengths 0 22.4k | file_path stringlengths 6 155 | comment_line int64 0 26 | language stringclasses 19
values | quality_score float64 0.07 1 | comment_type stringclasses 9
values | comment_length int64 16 20.6k | before_lines int64 2 4.61k | after_lines int64 2 4.4k | is_negative bool 2
classes | pr_title stringlengths 7 140 | pr_number int64 18 61.2k | repo_name stringclasses 29
values | repo_stars int64 321 56k | repo_language stringclasses 14
values | reviewer_username stringclasses 378
values | author_username stringclasses 739
values | user stringlengths 361 200k | assistant stringlengths 16 20.6k | system stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
This function allows specifying a custom conversion function for data types that cannot
be serialized automatically. When Taipy GUI encounters an unsupported type in the data
being serialized, it will invoke the provided *converter* function. The returned value
from this function will th... | use `_is_function` instead of `callable` | This function allows specifying a custom conversion function for data types that cannot
be serialized automatically. When Taipy GUI encounters an unsupported type in the data
being serialized, it will invoke the provided *converter* function. The returned value
from this function will th... | @@ -1143,6 +1143,41 @@ def __update_state_context(self, payload: dict):
for var, val in state_context.items():
self._update_var(var, val, True, forward=False)
+
+ @staticmethod
+ def set_unsupported_data_converter(converter: t.Optional[t.Callable[[t.Any], t.Any]]) -> None:
+ ... | taipy/gui/gui.py | 26 | Python | 0.286 | suggestion | 40 | 51 | 51 | false | Added a function to support data conversion if type is not supported by the taipy.gui.data module | 2,028 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | Ujj1225 | Review this pull request change.
Language: Python
File: taipy/gui/gui.py
PR Title: Added a function to support data conversion if type is not supported by the taipy.gui.data module
BEFORE CODE: This function allows specifying a custom conversion function for data types that cannot
be serialized auto... | use `_is_function` instead of `callable` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
if (changeDelay === -1) {
return;
}
if (changeDelay === 0) {
Promise.resolve().then(() => {
dispatch(createSendUpdateAction(updateVarName, val, module, onChange, propagate));
});
}
if (delayCa... | ~~this should always be called~~
~~So put outside the if/else block~~
I think you're right this should only be called if there is delayed call on hold
Sorry about the noise | setValue(val);
if (changeDelay === -1) {
return;
}
if (changeDelay === 0) {
Promise.resolve().then(() => {
dispatch(createSendUpdateAction(updateVarName, val, module, onChange, propagate));
});
... | @@ -138,6 +138,20 @@ const Input = (props: TaipyInputProps) => {
[changeDelay, dispatch, updateVarName, module, onChange, propagate]
);
+ const handleBlur = useCallback(
+ (e: React.FocusEvent<HTMLInputElement>) => {
+ const val = e.target.value;
+ if (changeDelay > 0 && ... | frontend/taipy-gui/src/components/Taipy/Input.tsx | 26 | TypeScript | 0.429 | suggestion | 175 | 51 | 51 | false | Input control validation on focus out event | 2,036 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | kart2004 | Review this pull request change.
Language: TypeScript
File: frontend/taipy-gui/src/components/Taipy/Input.tsx
PR Title: Input control validation on focus out event
BEFORE CODE: if (changeDelay === -1) {
return;
}
if (changeDelay === 0) {
Promise.re... | ~~this should always be called~~
~~So put outside the if/else block~~
I think you're right this should only be called if there is delayed call on hold
Sorry about the noise | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
cls._default_config._unique_sections[default_section.name] = default_section
elif def_sections := cls._default_config._sections.get(default_section.name, None):
def_sections[default_section.id] = default_section
else:
cls._default_config._sections[default_section.... | ```suggestion
cls._serializer._section_class[section.name] = section.__class__
cls.__json_serializer._section_class[section.name] = section.__class__
``` | cls._default_config._unique_sections[default_section.name] = default_section
elif def_sections := cls._default_config._sections.get(default_section.name, None):
def_sections[default_section.id] = default_section
else:
cls._default_config._sections[default_section.... | @@ -283,8 +283,8 @@ def _register(cls, section) -> None:
sections[section.id] = section
else:
cls._python_config._sections[section.name] = {section.id: section}
- cls._serializer._section_class[section.name] = section.__class__
- cls.__json_serializer._section_class[... | taipy/common/config/config.py | 26 | Python | 0.714 | suggestion | 172 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/common/config/config.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: cls._default_config._unique_sections[default_section.name] = default_section
... | ```suggestion
cls._serializer._section_class[section.name] = section.__class__
cls.__json_serializer._section_class[section.name] = section.__class__
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import sys
import typing as t
from flask import Flask
from taipy.core import Orchestrator
from taipy.gui import Gui
from taipy.rest import Rest
if sys.version_info >= (3, 10):
from typing import TypeGuard
_AppType = t.Union[Gui, Rest, Orchestrator]
_AppTypeT = t.TypeVar("_AppTypeT", Gui, Rest, Orchestrator)
d... | ```suggestion
**kwargs: Other parameters to provide to the services.
``` | import sys
import typing as t
from flask import Flask
from taipy.core import Orchestrator
from taipy.gui import Gui
from taipy.rest import Rest
if sys.version_info >= (3, 10):
from typing import TypeGuard
_AppType = t.Union[Gui, Rest, Orchestrator]
_AppTypeT = t.TypeVar("_AppTypeT", Gui, Rest, Orchestrator)
d... | @@ -30,11 +30,11 @@ def _run(*services: _AppType, **kwargs) -> t.Optional[Flask]:
A Taipy service is an instance of a class that runs code as a Web application.
- Parameters:
+ Arguments:
*services (Union[`Gui^`, `Rest^`, `Orchestrator^`]): Services to run, as separate arguments.<br/>
... | taipy/_run.py | 26 | Python | 0.571 | suggestion | 82 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/_run.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: import sys
import typing as t
from flask import Flask
from taipy.core import Orchestrator
from taipy.gui import Gui... | ```suggestion
**kwargs: Other parameters to provide to the services.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
@classmethod
def configure_parquet_data_node(
cls,
id: str,
default_path: Optional[str] = None,
engine: Optional[str] = None,
compression: Optional[str] = None,
read_kwargs: Optional[Dict] = None,
write_kwargs: Optional[Dict] = None,
exposed_type:... | ```suggestion
read_kwargs (Optional[dict]): Additional parameters passed to the `pandas.read_parquet()`
``` |
@classmethod
def configure_parquet_data_node(
cls,
id: str,
default_path: Optional[str] = None,
engine: Optional[str] = None,
compression: Optional[str] = None,
read_kwargs: Optional[Dict] = None,
write_kwargs: Optional[Dict] = None,
exposed_type:... | @@ -496,20 +496,20 @@ class Config:
) -> "DataNodeConfig":
"""Configure a new Parquet data node configuration.
- Parameters:
+ Arguments:
id (str): The unique identifier of the new Parquet data node configuration.
default_path (Optional[str]): The default path of ... | taipy/common/config/config.pyi | 26 | Python | 0.714 | suggestion | 121 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/common/config/config.pyi
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE:
@classmethod
def configure_parquet_data_node(
cls,
id: str,
default... | ```suggestion
read_kwargs (Optional[dict]): Additional parameters passed to the `pandas.read_parquet()`
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
def configure_parquet_data_node(
cls,
id: str,
default_path: Optional[str] = None,
engine: Optional[str] = None,
compression: Optional[str] = None,
read_kwargs: Optional[Dict] = None,
write_kwargs: Optional[Dict] = None,
exposed_type: Optional[str] = N... | ```suggestion
write_kwargs (Optional[dict]): Additional parameters passed to the
``` | def configure_parquet_data_node(
cls,
id: str,
default_path: Optional[str] = None,
engine: Optional[str] = None,
compression: Optional[str] = None,
read_kwargs: Optional[Dict] = None,
write_kwargs: Optional[Dict] = None,
exposed_type: Optional[str] = N... | @@ -496,20 +496,20 @@ class Config:
) -> "DataNodeConfig":
"""Configure a new Parquet data node configuration.
- Parameters:
+ Arguments:
id (str): The unique identifier of the new Parquet data node configuration.
default_path (Optional[str]): The default path of ... | taipy/common/config/config.pyi | 26 | Python | 0.571 | suggestion | 98 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/common/config/config.pyi
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: def configure_parquet_data_node(
cls,
id: str,
default_path: Optional[st... | ```suggestion
write_kwargs (Optional[dict]): Additional parameters passed to the
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
default_path: Optional[str] = None,
engine: Optional[str] = None,
compression: Optional[str] = None,
read_kwargs: Optional[Dict] = None,
write_kwargs: Optional[Dict] = None,
exposed_type: Optional[str] = None,
scope: Optional[Scope] = None,
validity_period... | ```suggestion
The parameters in *read_kwargs* and *write_kwargs* have a **higher precedence**
than the top-level parameters which are also passed to Pandas.
``` | default_path: Optional[str] = None,
engine: Optional[str] = None,
compression: Optional[str] = None,
read_kwargs: Optional[Dict] = None,
write_kwargs: Optional[Dict] = None,
exposed_type: Optional[str] = None,
scope: Optional[Scope] = None,
validity_period... | @@ -496,20 +496,20 @@ class Config:
) -> "DataNodeConfig":
"""Configure a new Parquet data node configuration.
- Parameters:
+ Arguments:
id (str): The unique identifier of the new Parquet data node configuration.
default_path (Optional[str]): The default path of ... | taipy/common/config/config.pyi | 26 | Python | 0.714 | suggestion | 196 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/common/config/config.pyi
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: default_path: Optional[str] = None,
engine: Optional[str] = None,
compressio... | ```suggestion
The parameters in *read_kwargs* and *write_kwargs* have a **higher precedence**
than the top-level parameters which are also passed to Pandas.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
[page](../../../../../../userman/scenario_features/task-orchestration/scenario-config.md#from-task-configurations)
for more details).
If *validity_period* is set to None, the data node is always up-to-date.
**properties (dict[str, any]): A keyworded variable l... | ```suggestion
So it is designed to handle small data values like parameters, and it must be Json serializable.
``` | [page](../../../../../../userman/scenario_features/task-orchestration/scenario-config.md#from-task-configurations)
for more details).
If *validity_period* is set to None, the data node is always up-to-date.
**properties (dict[str, any]): A keyworded variable l... | @@ -610,12 +610,12 @@ class Config:
) -> "DataNodeConfig":
"""Configure a new *in-memory* data node configuration.
- Parameters:
+ Arguments:
id (str): The unique identifier of the new in_memory data node configuration.
default_data (Optional[any]): The default da... | taipy/common/config/config.pyi | 26 | Python | 0.857 | suggestion | 132 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/common/config/config.pyi
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: [page](../../../../../../userman/scenario_features/task-orchestration/scenario-confi... | ```suggestion
So it is designed to handle small data values like parameters, and it must be Json serializable.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
If *validity_period* is set to None, the data node is always up-to-date.
**properties (dict[str, any]): A keyworded variable length list of additional arguments.
Returns:
The new *in-memory* data node configuration.
""" # noqa: E501
@classmethod
def con... | ```suggestion
So it is designed to handle small data values like parameters, and it must be Json serializable.
``` | If *validity_period* is set to None, the data node is always up-to-date.
**properties (dict[str, any]): A keyworded variable length list of additional arguments.
Returns:
The new *in-memory* data node configuration.
""" # noqa: E501
@classmethod
def con... | @@ -642,13 +642,13 @@ class Config:
) -> "DataNodeConfig":
"""Configure a new pickle data node configuration.
- Parameters:
+ Arguments:
id (str): The unique identifier of the new pickle data node configuration.
default_path (Optional[str]): The path of the pickle... | taipy/common/config/config.pyi | 26 | Python | 0.857 | suggestion | 132 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/common/config/config.pyi
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: If *validity_period* is set to None, the data node is always up-to-date.
... | ```suggestion
So it is designed to handle small data values like parameters, and it must be Json serializable.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
# Copyright 2021-2024 Avaiga Private Limited
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | ```suggestion
accepts hashable parameters, the `"mongodb_extra_args"` should be converted into a frozenset beforehand.
``` | # Copyright 2021-2024 Avaiga Private Limited
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | @@ -20,9 +20,9 @@ def _connect_mongodb(
) -> pymongo.MongoClient:
"""Create a connection to a Mongo database.
The `"mongodb_extra_args"` passed by the user is originally a dictionary, but since `@lru_cache` wrapper only
- accepts hashable parameters, the `"mongodb_extra_args"` should be converted into a f... | taipy/core/common/_mongo_connector.py | 23 | Python | 0.786 | suggestion | 128 | 48 | 48 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/core/common/_mongo_connector.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: # Copyright 2021-2024 Avaiga Private Limited
#
# Licensed under the Apache License, Version 2... | ```suggestion
accepts hashable parameters, the `"mongodb_extra_args"` should be converted into a frozenset beforehand.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
@classmethod
def _configure_parquet(
cls,
id: str,
default_path: Optional[str] = None,
engine: Optional[str] = None,
compression: Optional[str] = None,
read_kwargs: Optional[Dict] = None,
write_kwargs: Optional[Dict] = None,
exposed_type: Optional... | ```suggestion
read_kwargs (Optional[dict]): Additional parameters passed to the `pandas.read_parquet()`
``` |
@classmethod
def _configure_parquet(
cls,
id: str,
default_path: Optional[str] = None,
engine: Optional[str] = None,
compression: Optional[str] = None,
read_kwargs: Optional[Dict] = None,
write_kwargs: Optional[Dict] = None,
exposed_type: Optional... | @@ -610,20 +610,20 @@ def _configure_parquet(
) -> "DataNodeConfig":
"""Configure a new Parquet data node configuration.
- Parameters:
+ Arguments:
id (str): The unique identifier of the new Parquet data node configuration.
default_path (Optional[str]): The defaul... | taipy/core/config/data_node_config.py | 26 | Python | 0.714 | suggestion | 121 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/core/config/data_node_config.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE:
@classmethod
def _configure_parquet(
cls,
id: str,
default_p... | ```suggestion
read_kwargs (Optional[dict]): Additional parameters passed to the `pandas.read_parquet()`
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
def _configure_parquet(
cls,
id: str,
default_path: Optional[str] = None,
engine: Optional[str] = None,
compression: Optional[str] = None,
read_kwargs: Optional[Dict] = None,
write_kwargs: Optional[Dict] = None,
exposed_type: Optional[str] = None,
... | ```suggestion
write_kwargs (Optional[dict]): Additional parameters passed to the
``` | def _configure_parquet(
cls,
id: str,
default_path: Optional[str] = None,
engine: Optional[str] = None,
compression: Optional[str] = None,
read_kwargs: Optional[Dict] = None,
write_kwargs: Optional[Dict] = None,
exposed_type: Optional[str] = None,
... | @@ -610,20 +610,20 @@ def _configure_parquet(
) -> "DataNodeConfig":
"""Configure a new Parquet data node configuration.
- Parameters:
+ Arguments:
id (str): The unique identifier of the new Parquet data node configuration.
default_path (Optional[str]): The defaul... | taipy/core/config/data_node_config.py | 26 | Python | 0.571 | suggestion | 98 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/core/config/data_node_config.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: def _configure_parquet(
cls,
id: str,
default_path: Optional[str]... | ```suggestion
write_kwargs (Optional[dict]): Additional parameters passed to the
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
default_path: Optional[str] = None,
engine: Optional[str] = None,
compression: Optional[str] = None,
read_kwargs: Optional[Dict] = None,
write_kwargs: Optional[Dict] = None,
exposed_type: Optional[str] = None,
scope: Optional[Scope] = None,
validity_period... | ```suggestion
The parameters in *read_kwargs* and *write_kwargs* have a **higher precedence** than the
top-level parameters which are also passed to Pandas.
``` | default_path: Optional[str] = None,
engine: Optional[str] = None,
compression: Optional[str] = None,
read_kwargs: Optional[Dict] = None,
write_kwargs: Optional[Dict] = None,
exposed_type: Optional[str] = None,
scope: Optional[Scope] = None,
validity_period... | @@ -610,20 +610,20 @@ def _configure_parquet(
) -> "DataNodeConfig":
"""Configure a new Parquet data node configuration.
- Parameters:
+ Arguments:
id (str): The unique identifier of the new Parquet data node configuration.
default_path (Optional[str]): The defaul... | taipy/core/config/data_node_config.py | 26 | Python | 0.714 | suggestion | 195 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/core/config/data_node_config.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: default_path: Optional[str] = None,
engine: Optional[str] = None,
com... | ```suggestion
The parameters in *read_kwargs* and *write_kwargs* have a **higher precedence** than the
top-level parameters which are also passed to Pandas.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
if write_fct is not None:
properties[cls._OPTIONAL_WRITE_FUNCTION_GENERIC_PROPERTY] = write_fct
if read_fct_args is not None:
properties[cls._OPTIONAL_READ_FUNCTION_ARGS_GENERIC_PROPERTY] = read_fct_args
if write_fct_args is not None:
properties[cls._OPTIONAL_... | ```suggestion
So it is designed to handle small data values like parameters, and it must be Json serializable.
``` | if write_fct is not None:
properties[cls._OPTIONAL_WRITE_FUNCTION_GENERIC_PROPERTY] = write_fct
if read_fct_args is not None:
properties[cls._OPTIONAL_READ_FUNCTION_ARGS_GENERIC_PROPERTY] = read_fct_args
if write_fct_args is not None:
properties[cls._OPTIONAL_... | @@ -758,12 +758,12 @@ def _configure_in_memory(
) -> "DataNodeConfig":
"""Configure a new *in-memory* data node configuration.
- Parameters:
+ Arguments:
id (str): The unique identifier of the new in_memory data node configuration.
default_data (Optional[any]): Th... | taipy/core/config/data_node_config.py | 26 | Python | 0.857 | suggestion | 132 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/core/config/data_node_config.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: if write_fct is not None:
properties[cls._OPTIONAL_WRITE_FUNCTION_GENERIC... | ```suggestion
So it is designed to handle small data values like parameters, and it must be Json serializable.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
The new *in-memory* data node configuration.
""" # noqa: E501
if default_data is not None:
properties[cls._OPTIONAL_DEFAULT_DATA_IN_MEMORY_PROPERTY] = default_data
return cls.__configure(id, DataNodeConfig._STORAGE_TYPE_VALUE_IN_MEMORY, scope, validity_period, **propert... | ```suggestion
So it is designed to handle small data values like parameters, and it must be Json serializable.
``` | The new *in-memory* data node configuration.
""" # noqa: E501
if default_data is not None:
properties[cls._OPTIONAL_DEFAULT_DATA_IN_MEMORY_PROPERTY] = default_data
return cls.__configure(id, DataNodeConfig._STORAGE_TYPE_VALUE_IN_MEMORY, scope, validity_period, **propert... | @@ -794,13 +794,13 @@ def _configure_pickle(
) -> "DataNodeConfig":
"""Configure a new pickle data node configuration.
- Parameters:
+ Arguments:
id (str): The unique identifier of the new pickle data node configuration.
default_path (Optional[str]): The path of t... | taipy/core/config/data_node_config.py | 26 | Python | 0.857 | suggestion | 132 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/core/config/data_node_config.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: The new *in-memory* data node configuration.
""" # noqa: E501
if... | ```suggestion
So it is designed to handle small data values like parameters, and it must be Json serializable.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
from ..exceptions.exceptions import UnknownCompressionAlgorithm, UnknownParquetEngine
from ..job.job_id import JobId
from ._file_datanode_mixin import _FileDataNodeMixin
from ._tabular_datanode_mixin import _TabularDataNodeMixin
from .data_node import DataNode
from .data_node_id import DataNodeId, Edit
class ParquetD... | ```suggestion
- *read_kwargs* (`Optional[dict]`): Additional parameters passed to the
``` | from ..exceptions.exceptions import UnknownCompressionAlgorithm, UnknownParquetEngine
from ..job.job_id import JobId
from ._file_datanode_mixin import _FileDataNodeMixin
from ._tabular_datanode_mixin import _TabularDataNodeMixin
from .data_node import DataNode
from .data_node_id import DataNodeId, Edit
class ParquetD... | @@ -45,14 +45,14 @@ class ParquetDataNode(DataNode, _FileDataNodeMixin, _TabularDataNodeMixin):
- *compression* (`Optional[str]`): Name of the compression to use. Possible values
are *"snappy"*, *"gzip"*, *"brotli"*, or *"none"* (no compression).<br/>
The default value is *"snappy"*.
- - *read... | taipy/core/data/parquet.py | 26 | Python | 0.571 | suggestion | 95 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/core/data/parquet.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: from ..exceptions.exceptions import UnknownCompressionAlgorithm, UnknownParquetEngine
from ..job.job_id ... | ```suggestion
- *read_kwargs* (`Optional[dict]`): Additional parameters passed to the
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
from .data_node import DataNode
from .data_node_id import DataNodeId, Edit
class ParquetDataNode(DataNode, _FileDataNodeMixin, _TabularDataNodeMixin):
"""Data Node stored as a Parquet file.
The *properties* attribute can contain the following optional entries:
- *default_path* (`str`): The default path ... | ```suggestion
The parameters in *"read_kwargs"* have a **higher precedence** than the top-level
parameters which are also passed to Pandas.
- *write_kwargs* (`Optional[dict]`): Additional parameters passed to the
``` | from .data_node import DataNode
from .data_node_id import DataNodeId, Edit
class ParquetDataNode(DataNode, _FileDataNodeMixin, _TabularDataNodeMixin):
"""Data Node stored as a Parquet file.
The *properties* attribute can contain the following optional entries:
- *default_path* (`str`): The default path ... | @@ -45,14 +45,14 @@ class ParquetDataNode(DataNode, _FileDataNodeMixin, _TabularDataNodeMixin):
- *compression* (`Optional[str]`): Name of the compression to use. Possible values
are *"snappy"*, *"gzip"*, *"brotli"*, or *"none"* (no compression).<br/>
The default value is *"snappy"*.
- - *read... | taipy/core/data/parquet.py | 26 | Python | 0.786 | suggestion | 240 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/core/data/parquet.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: from .data_node import DataNode
from .data_node_id import DataNodeId, Edit
class ParquetDataNode(DataN... | ```suggestion
The parameters in *"read_kwargs"* have a **higher precedence** than the top-level
parameters which are also passed to Pandas.
- *write_kwargs* (`Optional[dict]`): Additional parameters passed to the
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
class ParquetDataNode(DataNode, _FileDataNodeMixin, _TabularDataNodeMixin):
"""Data Node stored as a Parquet file.
The *properties* attribute can contain the following optional entries:
- *default_path* (`str`): The default path of the Parquet file used at the instantiation of
the data node.
... | ```suggestion
The parameters in *"write_kwargs"* have a **higher precedence** than the
top-level parameters which are also passed to Pandas.
``` |
class ParquetDataNode(DataNode, _FileDataNodeMixin, _TabularDataNodeMixin):
"""Data Node stored as a Parquet file.
The *properties* attribute can contain the following optional entries:
- *default_path* (`str`): The default path of the Parquet file used at the instantiation of
the data node.
... | @@ -45,14 +45,14 @@ class ParquetDataNode(DataNode, _FileDataNodeMixin, _TabularDataNodeMixin):
- *compression* (`Optional[str]`): Name of the compression to use. Possible values
are *"snappy"*, *"gzip"*, *"brotli"*, or *"none"* (no compression).<br/>
The default value is *"snappy"*.
- - *read... | taipy/core/data/parquet.py | 26 | Python | 0.714 | suggestion | 163 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/core/data/parquet.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE:
class ParquetDataNode(DataNode, _FileDataNodeMixin, _TabularDataNodeMixin):
"""Data Node stored as ... | ```suggestion
The parameters in *"write_kwargs"* have a **higher precedence** than the
top-level parameters which are also passed to Pandas.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
def name(self, val) -> None:
self.properties["name"] = val
def has_tag(self, tag: str) -> bool:
"""Indicate if the scenario has a given tag.
Arguments:
tag (str): The tag to search among the set of scenario's tags.
Returns:
True if the scenario has the ... | ```suggestion
params (Optional[List[Any]]): The parameters to be passed to the _callback_.
``` | def name(self, val) -> None:
self.properties["name"] = val
def has_tag(self, tag: str) -> bool:
"""Indicate if the scenario has a given tag.
Arguments:
tag (str): The tag to search among the set of scenario's tags.
Returns:
True if the scenario has the ... | @@ -358,10 +358,10 @@ def subscribe(self, callback: Callable[[Scenario, Job], None], params: Optional[
Note:
Notification will be available only for jobs created after this subscription.
- Parameters:
+ Arguments:
callback (Callable[[Scenario^, Job^], None]): The calla... | taipy/core/scenario/scenario.py | 26 | Python | 0.714 | suggestion | 108 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/core/scenario/scenario.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: def name(self, val) -> None:
self.properties["name"] = val
def has_tag(self, tag: ... | ```suggestion
params (Optional[List[Any]]): The parameters to be passed to the _callback_.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
def subscribe(self, callback: Callable[[Scenario, Job], None], params: Optional[List[Any]] = None) -> None:
"""Subscribe a function to be called on `Job^` status change.
The subscription is applied to all jobs created from the scenario's execution.
Note:
Notification will be av... | ```suggestion
params (Optional[List[Any]]): The parameters to be passed to the _callback_.
``` | def subscribe(self, callback: Callable[[Scenario, Job], None], params: Optional[List[Any]] = None) -> None:
"""Subscribe a function to be called on `Job^` status change.
The subscription is applied to all jobs created from the scenario's execution.
Note:
Notification will be av... | @@ -373,9 +373,9 @@ def unsubscribe(self, callback: Callable[[Scenario, Job], None], params: Optiona
Note:
The function will continue to be called for ongoing jobs.
- Parameters:
+ Arguments:
callback (Callable[[Scenario^, Job^], None]): The callable function to unsubs... | taipy/core/scenario/scenario.py | 26 | Python | 0.714 | suggestion | 108 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/core/scenario/scenario.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: def subscribe(self, callback: Callable[[Scenario, Job], None], params: Optional[List[Any]] = No... | ```suggestion
params (Optional[List[Any]]): The parameters to be passed to the _callback_.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
Returns:
The dictionary of all parent entities.
They are grouped by their type (Scenario^, Sequences^, or tasks^) so each key corresponds
to a level of the parents and the value is a set of the parent entities.
An empty dictionary is returned if the e... | ```suggestion
params (Optional[List[Any]]): The parameters to be passed to the _callback_.
``` |
Returns:
The dictionary of all parent entities.
They are grouped by their type (Scenario^, Sequences^, or tasks^) so each key corresponds
to a level of the parents and the value is a set of the parent entities.
An empty dictionary is returned if the e... | @@ -264,10 +264,10 @@ def subscribe(
Note:
Notification will be available only for jobs created after this subscription.
- Parameters:
+ Arguments:
callback (Callable[[Sequence^, Job^], None]): The callable function to be called on
status change.
- ... | taipy/core/sequence/sequence.py | 26 | Python | 0.714 | suggestion | 108 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/core/sequence/sequence.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE:
Returns:
The dictionary of all parent entities.
They are group... | ```suggestion
params (Optional[List[Any]]): The parameters to be passed to the _callback_.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
params: Optional[List[Any]] = None,
) -> None:
"""Subscribe a function to be called on `Job^` status change.
The subscription is applied to all jobs created from the sequence's execution.
Note:
Notification will be available only for jobs created after this subscription.... | ```suggestion
params (Optional[List[Any]]): The parameters to be passed to the _callback_.
``` | params: Optional[List[Any]] = None,
) -> None:
"""Subscribe a function to be called on `Job^` status change.
The subscription is applied to all jobs created from the sequence's execution.
Note:
Notification will be available only for jobs created after this subscription.... | @@ -279,9 +279,9 @@ def unsubscribe(self, callback: Callable[[Sequence, Job], None], params: Optiona
Note:
The function will continue to be called for ongoing jobs.
- Parameters:
+ Arguments:
callback (Callable[[Sequence^, Job^], None]): The callable function to unsubs... | taipy/core/sequence/sequence.py | 26 | Python | 0.714 | suggestion | 108 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/core/sequence/sequence.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: params: Optional[List[Any]] = None,
) -> None:
"""Subscribe a function to be ca... | ```suggestion
params (Optional[List[Any]]): The parameters to be passed to the _callback_.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
Raises:
InsufficientScenarioToCompare^: Raised when only one or no scenario for comparison
is provided.
NonExistingComparator^: Raised when the scenario comparator does not exist.
DifferentScenarioConfigs^: Raised when the provided scenarios do not share the
same scen... | ```suggestion
params (Optional[List[Any]]): The parameters to be passed to the _callback_.
``` | Raises:
InsufficientScenarioToCompare^: Raised when only one or no scenario for comparison
is provided.
NonExistingComparator^: Raised when the scenario comparator does not exist.
DifferentScenarioConfigs^: Raised when the provided scenarios do not share the
same scen... | @@ -685,10 +685,10 @@ def subscribe_scenario(
The subscription is applied to all jobs created for the execution of _scenario_.
If no scenario is provided, the subscription applies to all scenarios.
- Parameters:
+ Arguments:
callback (Callable[[Scenario^, Job^], None]): The function to be cal... | taipy/core/taipy.py | 26 | Python | 0.714 | suggestion | 104 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/core/taipy.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: Raises:
InsufficientScenarioToCompare^: Raised when only one or no scenario for comparison
... | ```suggestion
params (Optional[List[Any]]): The parameters to be passed to the _callback_.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
If no scenario is provided, the subscription applies to all scenarios.
Arguments:
callback (Callable[[Scenario^, Job^], None]): The function to be called on
status change.
params (Optional[List[Any]]): The arguments to be passed to the _callback_.
scenario (Optional[Scenario... | ```suggestion
params (Optional[List[Any]]): The parameters to be passed to the callback.
``` | If no scenario is provided, the subscription applies to all scenarios.
Arguments:
callback (Callable[[Scenario^, Job^], None]): The function to be called on
status change.
params (Optional[List[Any]]): The parameters to be passed to the _callback_.
scenario (Optional[Scenari... | @@ -706,9 +706,9 @@ def unsubscribe_scenario(
If no scenario is provided, the subscription is removed for all scenarios.
- Parameters:
+ Arguments:
callback (Callable[[Scenario^, Job^], None]): The function to unsubscribe from.
- params (Optional[List[Any]]): The parameters to be passed t... | taipy/core/taipy.py | 26 | Python | 0.714 | suggestion | 102 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/core/taipy.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: If no scenario is provided, the subscription applies to all scenarios.
Arguments:
callback (Ca... | ```suggestion
params (Optional[List[Any]]): The parameters to be passed to the callback.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
If no scenario is provided, the subscription is removed for all scenarios.
Arguments:
callback (Callable[[Scenario^, Job^], None]): The function to unsubscribe from.
params (Optional[List[Any]]): The arguments to be passed to the callback.
scenario (Optional[Scenario]): The scenario to... | ```suggestion
params (Optional[List[Any]]): The parameters to be passed to the _callback_.
``` |
If no scenario is provided, the subscription is removed for all scenarios.
Arguments:
callback (Callable[[Scenario^, Job^], None]): The function to unsubscribe from.
params (Optional[List[Any]]): The parameters to be passed to the callback.
scenario (Optional[Scenario]): The scenario t... | @@ -725,10 +725,10 @@ def subscribe_sequence(
The subscription is applied to all jobs created for the execution of _sequence_.
- Parameters:
+ Arguments:
callback (Callable[[Sequence^, Job^], None]): The callable function to be called on
status change.
- params (Optional[List... | taipy/core/taipy.py | 26 | Python | 0.714 | suggestion | 104 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/core/taipy.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE:
If no scenario is provided, the subscription is removed for all scenarios.
Arguments:
callbac... | ```suggestion
params (Optional[List[Any]]): The parameters to be passed to the _callback_.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
"""Subscribe a function to be called on job status change.
The subscription is applied to all jobs created for the execution of _sequence_.
Arguments:
callback (Callable[[Sequence^, Job^], None]): The callable function to be called on
status change.
params (Optional[List[Any]])... | ```suggestion
params (Optional[List[Any]]): The parameters to be passed to the _callback_.
``` | """Subscribe a function to be called on job status change.
The subscription is applied to all jobs created for the execution of _sequence_.
Arguments:
callback (Callable[[Sequence^, Job^], None]): The callable function to be called on
status change.
params (Optional[List[Any]])... | @@ -743,10 +743,10 @@ def unsubscribe_sequence(
) -> None:
"""Unsubscribe a function that is called when the status of a Job changes.
- Parameters:
+ Arguments:
callback (Callable[[Sequence^, Job^], None]): The callable function to be called on
status change.
- params (Optiona... | taipy/core/taipy.py | 26 | Python | 0.714 | suggestion | 104 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/core/taipy.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: """Subscribe a function to be called on job status change.
The subscription is applied to all jobs cre... | ```suggestion
params (Optional[List[Any]]): The parameters to be passed to the _callback_.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing p... | ```suggestion
"""Hold a user function that will be executed, its parameters, and the results.
``` | # http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing p... | @@ -28,7 +28,7 @@
class Task(_Entity, _Labeled):
- """Hold a user function that will be executed, its parameters and the results.
+ """Hold a user function that will be executed, its arguments and the results. | taipy/core/task/task.py | 26 | Python | 0.786 | suggestion | 103 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/core/task/task.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: # http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | ```suggestion
"""Hold a user function that will be executed, its parameters, and the results.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
- *state*: the `State^` instance of the caller.
"""
self.on_page_load: t.Optional[t.Callable] = None
"""This callback is invoked just before the page content is sent to the front-end.
It defaults to the `on_page_load()` global function defined in the Python
application.... | ```suggestion
- *params* (Optional): the query parameters provided in the URL.
``` |
- *state*: the `State^` instance of the caller.
"""
self.on_page_load: t.Optional[t.Callable] = None
"""This callback is invoked just before the page content is sent to the front-end.
It defaults to the `on_page_load()` global function defined in the Python
application.... | @@ -308,7 +308,7 @@ def __init__(
- *state*: the `State^` instance of the caller.
- *page_name*: the name of the page the user is navigating to.
- - *params* (Optional): the query parameters provided in the URL.
+ - *params* (Optional): the query arguments provided in the URL. | taipy/gui/gui.py | 26 | Python | 0.571 | suggestion | 92 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/gui/gui.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE:
- *state*: the `State^` instance of the caller.
"""
self.on_page_load: t.Optional[t.Calla... | ```suggestion
- *params* (Optional): the query parameters provided in the URL.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
"""The function that is called when the status page is shown.
It defaults to the `on_status()` global function defined in the Python
application. If there is no such function, status page content shows only the status of the
server.<br/>
The signature of the *on_status* callbac... | ```suggestion
- *parameters*: An optional dictionary as defined in the `get_user_content_url()^` call.
``` | """The function that is called when the status page is shown.
It defaults to the `on_status()` global function defined in the Python
application. If there is no such function, status page content shows only the status of the
server.<br/>
The signature of the *on_status* callbac... | @@ -352,10 +352,10 @@ def __init__(
- *state*: the `State^` instance of the caller.
- *path*: the path provided to the `get_user_content_url()^` to build the URL.
- - *parameters*: An optional dictionary as defined in the `get_user_content_url()^` call.
+ - *arguments*: An optional dic... | taipy/gui/gui.py | 26 | Python | 0.786 | suggestion | 116 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/gui/gui.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: """The function that is called when the status page is shown.
It defaults to the `on_status()` gl... | ```suggestion
- *parameters*: An optional dictionary as defined in the `get_user_content_url()^` call.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
application. If there is no such function, status page content shows only the status of the
server.<br/>
The signature of the *on_status* callback function must be:
- *state*: the `State^` instance of the caller.
It must return raw and valid HTML content as a string.
"... | ```suggestion
and the parameters provided in the call to `get_user_content_url()^`.
``` | application. If there is no such function, status page content shows only the status of the
server.<br/>
The signature of the *on_status* callback function must be:
- *state*: the `State^` instance of the caller.
It must return raw and valid HTML content as a string.
"... | @@ -352,10 +352,10 @@ def __init__(
- *state*: the `State^` instance of the caller.
- *path*: the path provided to the `get_user_content_url()^` to build the URL.
- - *parameters*: An optional dictionary as defined in the `get_user_content_url()^` call.
+ - *arguments*: An optional dic... | taipy/gui/gui.py | 26 | Python | 0.643 | suggestion | 97 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/gui/gui.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: application. If there is no such function, status page content shows only the status of the
server... | ```suggestion
and the parameters provided in the call to `get_user_content_url()^`.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
f"Gui.invoke_callback(): Exception raised in {_function_name(callback)}",
e,
)
finally:
if this_sid:
request.sid = this_sid # type: ignore[attr-defined]
return None
def broadcast_callback(
self,
cal... | ```suggestion
The other parameters should reflect the ones provided in the *args* collection.
args: The parameters to send to *callback*, if any.
``` | f"Gui.invoke_callback(): Exception raised in {_function_name(callback)}",
e,
)
finally:
if this_sid:
request.sid = this_sid # type: ignore[attr-defined]
return None
def broadcast_callback(
self,
cal... | @@ -1604,8 +1604,8 @@ def broadcast_callback(
callback: The user-defined function to be invoked.<br/>
The first parameter of this function must be a `State^` object representing the
client for which it is invoked.<br/>
- The other parameters should reflect t... | taipy/gui/gui.py | 26 | Python | 0.786 | suggestion | 180 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/gui/gui.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: f"Gui.invoke_callback(): Exception raised in {_function_name(callback)}",
... | ```suggestion
The other parameters should reflect the ones provided in the *args* collection.
args: The parameters to send to *callback*, if any.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
):
"""Download content to the client.
Arguments:
state (State^): The current user state as received in any callback.
content: File path or file content. See below.
name: File name for the content on the client browser (defaults to content name).
on_action: Callback function (or ... | ```suggestion
This callback can use three optional parameters:
``` | ):
"""Download content to the client.
Arguments:
state (State^): The current user state as received in any callback.
content: File path or file content. See below.
name: File name for the content on the client browser (defaults to content name).
on_action: Callback function (or ... | @@ -44,7 +44,7 @@ def download(
- *on_action*: this callback is triggered when the transfer of the content is achieved.</br>
In this function, you can perform any clean-up operation that could be required after
the download is completed.<br/>
- This callback can use three optiona... | taipy/gui/gui_actions.py | 26 | Python | 0.643 | suggestion | 78 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/gui/gui_actions.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: ):
"""Download content to the client.
Arguments:
state (State^): The current user state a... | ```suggestion
This callback can use three optional parameters:
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
must be allowed again for the user.
Arguments:
state (State^): The current user state as received in any callback.
"""
if state and isinstance(state._gui, Gui):
state._gui._resume_actions()
else:
_warn("'resume_actions()' must be called in the context of a callback.")
def ... | ```suggestion
params: A dictionary of query parameters.
``` | must be allowed again for the user.
Arguments:
state (State^): The current user state as received in any callback.
"""
if state and isinstance(state._gui, Gui):
state._gui._resume_actions()
else:
_warn("'resume_actions()' must be called in the context of a callback.")
def ... | @@ -165,7 +165,7 @@ def navigate(
to: The name of the page to navigate to. This can be a page identifier (as created by
`Gui.add_page()^` with no leading '/') or a URL.<br/>
If omitted, the application navigates to the root page.
- params: A dictionary of query parameters.
+ ... | taipy/gui/gui_actions.py | 26 | Python | 0.571 | suggestion | 69 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/gui/gui_actions.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: must be allowed again for the user.
Arguments:
state (State^): The current user state as ... | ```suggestion
params: A dictionary of query parameters.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
params: A dictionary of query arguments.
tab: When navigating to a page that is not a known page, the page is opened in a tab identified by
*tab* (as in [window.open](https://developer.mozilla.org/en-US/docs/Web/API/Window/open)).<br/>
The default value creates a new tab for the ... | ```suggestion
These arguments are added as query parameters to the generated URL and converted into
``` | params: A dictionary of query parameters.
tab: When navigating to a page that is not a known page, the page is opened in a tab identified by
*tab* (as in [window.open](https://developer.mozilla.org/en-US/docs/Web/API/Window/open)).<br/>
The default value creates a new tab for the... | @@ -190,7 +190,7 @@ def get_user_content_url(
state (State^): The current user state as received in any callback.
path: An optional additional path to the URL.
params: An optional dictionary sent to the *on_user_content* callback.<br/>
- These arguments are added as query parameter... | taipy/gui/gui_actions.py | 26 | Python | 0.714 | suggestion | 117 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/gui/gui_actions.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: params: A dictionary of query arguments.
tab: When navigating to a page that is not a know... | ```suggestion
These arguments are added as query parameters to the generated URL and converted into
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
args (Optional[Sequence]): The remaining arguments, as a List or a Tuple.
module_context (Optional[str]): the name of the module that will be used.
"""
if isinstance(gui, Gui):
return gui.invoke_callback(state_id, callback, args, module_context)
_warn("'invoke_callback()' must be cal... | ```suggestion
The other parameters should reflect the ones provided in the *args* collection.
args: The parameters to send to *callback*, if any.
``` | args (Optional[Sequence]): The remaining arguments, as a List or a Tuple.
module_context (Optional[str]): the name of the module that will be used.
"""
if isinstance(gui, Gui):
return gui.invoke_callback(state_id, callback, args, module_context)
_warn("'invoke_callback()' must be cal... | @@ -308,8 +308,8 @@ def broadcast_callback(
callback: The user-defined function to be invoked.<br/>
The first parameter of this function must be a `State^` object representing the
client for which it is invoked.<br/>
- The other parameters should reflect the ones provided i... | taipy/gui/gui_actions.py | 26 | Python | 0.786 | suggestion | 172 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/gui/gui_actions.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: args (Optional[Sequence]): The remaining arguments, as a List or a Tuple.
module_context (... | ```suggestion
The other parameters should reflect the ones provided in the *args* collection.
args: The parameters to send to *callback*, if any.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
)
if not flask_log:
log = logging.getLogger("werkzeug")
log.disabled = True
if not is_running_from_reloader():
_TaipyLogger._get_logger().info(f" * Server starting on http://{host_value}:{port}")
else:
_TaipyLogger._get_... | ```suggestion
# flask-socketio specific conditions for 'allow_unsafe_werkzeug' parameters to be popped out of kwargs
``` | )
if not flask_log:
log = logging.getLogger("werkzeug")
log.disabled = True
if not is_running_from_reloader():
_TaipyLogger._get_logger().info(f" * Server starting on http://{host_value}:{port}")
else:
_TaipyLogger._get_... | @@ -357,7 +357,7 @@ def run(
}
if self.__ssl_context is not None:
run_config["ssl_context"] = self.__ssl_context
- # flask-socketio specific conditions for 'allow_unsafe_werkzeug' parameters to be popped out of kwargs
+ # flask-socketio specific conditions for 'allow_unsafe_... | taipy/gui/server.py | 26 | Python | 0.714 | suggestion | 130 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/gui/server.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: )
if not flask_log:
log = logging.getLogger("werkzeug")
log.disable... | ```suggestion
# flask-socketio specific conditions for 'allow_unsafe_werkzeug' parameters to be popped out of kwargs
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under t... | ```suggestion
A Flask application is instantiated and configured using three parameters from the global
``` | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under t... | @@ -24,13 +24,13 @@ def __init__(self) -> None:
"""
Initialize a REST API server.
- A Flask application is instantiated and configured using three parameters from the global
+ A Flask application is instantiated and configured using three arguments from the global | taipy/rest/rest.py | 26 | Python | 0.714 | suggestion | 117 | 47 | 47 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/rest/rest.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: #
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in complian... | ```suggestion
A Flask application is instantiated and configured using three parameters from the global
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
from fla... | ```suggestion
However, editing these parameters is only recommended for advanced users. Indeed, the default behavior of the
``` | # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
from fla... | @@ -24,13 +24,13 @@ def __init__(self) -> None:
"""
Initialize a REST API server.
- A Flask application is instantiated and configured using three parameters from the global
+ A Flask application is instantiated and configured using three arguments from the global
config.
... | taipy/rest/rest.py | 26 | Python | 0.786 | suggestion | 137 | 41 | 41 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/rest/rest.py
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: # Unless required by applicable law or agreed to in writing, software distributed under the License is distribut... | ```suggestion
However, editing these parameters is only recommended for advanced users. Indeed, the default behavior of the
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
id: str,
default_path: Optional[str] = None,
engine: Optional[str] = None,
compression: Optional[str] = None,
read_kwargs: Optional[Dict] = None,
write_kwargs: Optional[Dict] = None,
exposed_type: Optional[str] = None,
scope: Optional[Scope] = None,
... | ```suggestion
The parameters in *read_kwargs* and *write_kwargs* have a **higher precedence**
``` | id: str,
default_path: Optional[str] = None,
engine: Optional[str] = None,
compression: Optional[str] = None,
read_kwargs: Optional[Dict] = None,
write_kwargs: Optional[Dict] = None,
exposed_type: Optional[str] = None,
scope: Optional[Scope] = None,
... | @@ -508,8 +508,8 @@ class Config:
function.
write_kwargs (Optional[dict]): Additional parameters passed to the
`pandas.DataFrame.write_parquet()` function.<br/>
- The parameters in *read_kwargs* and *write_kwargs* have a **higher precedence** than the
- ... | taipy/common/config/config.pyi | 26 | Python | 0.714 | suggestion | 115 | 51 | 51 | false | Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase. | 2,046 | Avaiga/taipy | 12,680 | Python | jrobinAV | DevyManish | Review this pull request change.
Language: Python
File: taipy/common/config/config.pyi
PR Title: Refactor terminology: Updated 'Parameters' and 'Args' to 'Arguments' for consistency across the codebase.
BEFORE CODE: id: str,
default_path: Optional[str] = None,
engine: Optional[str] = None,
... | ```suggestion
The parameters in *read_kwargs* and *write_kwargs* have a **higher precedence**
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
# specific language governing permissions and limitations under the License.
# -----------------------------------------------------------------------------------------
# To execute this script, make sure that the taipy-gui package is installed in your
# Python environment and run:
# python <script>
# -------------... | I don't think you need min and max: values are based on the dict keys. | # specific language governing permissions and limitations under the License.
# -----------------------------------------------------------------------------------------
# To execute this script, make sure that the taipy-gui package is installed in your
# Python environment and run:
# python <script>
# -------------... | @@ -0,0 +1,41 @@
+# Copyright 2021-2024 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required b... | doc/gui/examples/controls/slider_labels_dictionary.py | 26 | Python | 0.214 | suggestion | 70 | 33 | 30 | false | Add Example for Slider Labels in Taipy GUI | 2,077 | Avaiga/taipy | 12,680 | Python | FabienLelaquais | JeevaRamanathan | Review this pull request change.
Language: Python
File: doc/gui/examples/controls/slider_labels_dictionary.py
PR Title: Add Example for Slider Labels in Taipy GUI
BEFORE CODE: # specific language governing permissions and limitations under the License.
# ------------------------------------------------------------... | I don't think you need min and max: values are based on the dict keys. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
# Copyright 2021-2024 Avaiga Private Limited
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | ```suggestion
labels = {
0: "One",
1: "Two",
2: "Three",
3: "Four",
4: "Five",
5: "Six",
```
really showing the added value of key/value pairs. | # Copyright 2021-2024 Avaiga Private Limited
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | @@ -0,0 +1,41 @@
+# Copyright 2021-2024 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required b... | doc/gui/examples/controls/slider_labels_dictionary.py | 19 | Python | 0.714 | suggestion | 178 | 42 | 39 | false | Add Example for Slider Labels in Taipy GUI | 2,077 | Avaiga/taipy | 12,680 | Python | FabienLelaquais | JeevaRamanathan | Review this pull request change.
Language: Python
File: doc/gui/examples/controls/slider_labels_dictionary.py
PR Title: Add Example for Slider Labels in Taipy GUI
BEFORE CODE: # Copyright 2021-2024 Avaiga Private Limited
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file ... | ```suggestion
labels = {
0: "One",
1: "Two",
2: "Three",
3: "Four",
4: "Five",
5: "Six",
```
really showing the added value of key/value pairs. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# ------... | ```suggestion
```
This line is useless: that would be the tab's title. | # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# ------... | @@ -0,0 +1,41 @@
+# Copyright 2021-2024 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required b... | doc/gui/examples/controls/slider_labels_dictionary.py | 26 | Python | 0.643 | suggestion | 72 | 35 | 32 | false | Add Example for Slider Labels in Taipy GUI | 2,077 | Avaiga/taipy | 12,680 | Python | FabienLelaquais | JeevaRamanathan | Review this pull request change.
Language: Python
File: doc/gui/examples/controls/slider_labels_dictionary.py
PR Title: Add Example for Slider Labels in Taipy GUI
BEFORE CODE: # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
# an "AS IS" BASIS, W... | ```suggestion
```
This line is useless: that would be the tab's title. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
# specific language governing permissions and limitations under the License.
# -----------------------------------------------------------------------------------------
# To execute this script, make sure that the taipy-gui package is installed in your
# Python environment and run:
# python <script>
# -------------... | ```suggestion
<|{value}|slider|labels={labels}|>
``` | # specific language governing permissions and limitations under the License.
# -----------------------------------------------------------------------------------------
# To execute this script, make sure that the taipy-gui package is installed in your
# Python environment and run:
# python <script>
# -------------... | @@ -0,0 +1,41 @@
+# Copyright 2021-2024 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required b... | doc/gui/examples/controls/slider_labels_dictionary.py | 26 | Python | 0.571 | suggestion | 54 | 33 | 30 | false | Add Example for Slider Labels in Taipy GUI | 2,077 | Avaiga/taipy | 12,680 | Python | FabienLelaquais | JeevaRamanathan | Review this pull request change.
Language: Python
File: doc/gui/examples/controls/slider_labels_dictionary.py
PR Title: Add Example for Slider Labels in Taipy GUI
BEFORE CODE: # specific language governing permissions and limitations under the License.
# ------------------------------------------------------------... | ```suggestion
<|{value}|slider|labels={labels}|>
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# ----... | as @FabienLelaquais mentioned, can you remove min and max ?
and change the labels dictionary to spread from 0 to 100 ? | #
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# ----... | @@ -0,0 +1,38 @@
+# Copyright 2021-2024 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required b... | doc/gui/examples/controls/slider_labels_dictionary.py | 26 | Python | 0.429 | question | 119 | 33 | 33 | false | Add Example for Slider Labels in Taipy GUI | 2,077 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | JeevaRamanathan | Review this pull request change.
Language: Python
File: doc/gui/examples/controls/slider_labels_dictionary.py
PR Title: Add Example for Slider Labels in Taipy GUI
BEFORE CODE: #
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
# an "AS IS" BASIS,... | as @FabienLelaquais mentioned, can you remove min and max ?
and change the labels dictionary to spread from 0 to 100 ? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
return (
<Tooltip title={hover || ""}>
<Paper className={`${className} ${getComponentClassName(props.children)}`} sx={boxSx} id={id}>
<Grid container rowSpacing={2} sx={gridSx} ref={scrollDivRef}>
{rows.length && !rows[0] ? (
<Grid cla... | image={columns[3] && columns[3] != "_tp_index" ? `${row[columns[3]]}` : undefined}
| URL.revokeObjectURL(objectURL);
}
};
}, [objectURLs]);
const loadOlder = useCallback(
(evt: MouseEvent<HTMLElement>) => {
const { start } = evt.currentTarget.dataset;
if (start) {
loadMoreItems(parseInt(start));
}
... | @@ -424,6 +463,7 @@ const Chat = (props: ChatProps) => {
senderId={senderId}
message={`${row[columns[1]]}`}
name={columns[2] ? `${row[columns[2]]}` : "Unknown"}
+ image={row[columns[3]] ? `$... | frontend/taipy-gui/src/components/Taipy/Chat.tsx | 26 | TypeScript | 0.5 | suggestion | 84 | 51 | 51 | false | Implemented image upload on Chat | 2,078 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | Satoshi-Sh | Review this pull request change.
Language: TypeScript
File: frontend/taipy-gui/src/components/Taipy/Chat.tsx
PR Title: Implemented image upload on Chat
BEFORE CODE:
return (
<Tooltip title={hover || ""}>
<Paper className={`${className} ${getComponentClassName(props.children)}`} sx={boxSx} i... | image={columns[3] && columns[3] != "_tp_index" ? `${row[columns[3]]}` : undefined}
| You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
await userEvent.click(elt);
await userEvent.keyboard("new message");
await userEvent.click(getByRole("button",{ name: /send message/i }))
expect(dispatch).toHaveBeenCalledWith({
type: "SEND_ACTION_ACTION",
name: "",
context: undefined,
payl... | create before test
and reset after test | await userEvent.click(elt);
await userEvent.keyboard("new message");
await userEvent.click(getByRole("button",{ name: /send message/i }))
expect(dispatch).toHaveBeenCalledWith({
type: "SEND_ACTION_ACTION",
name: "",
context: undefined,
payl... | @@ -123,15 +123,61 @@ describe("Chat Component", () => {
const elt = getByLabelText("message (taipy)");
await userEvent.click(elt);
await userEvent.keyboard("new message");
- await userEvent.click(getByRole("button"))
+ await userEvent.click(getByRole("button",{ name: /send mess... | frontend/taipy-gui/src/components/Taipy/Chat.spec.tsx | 26 | TypeScript | 0.071 | suggestion | 40 | 51 | 51 | false | Implemented image upload on Chat | 2,078 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | Satoshi-Sh | Review this pull request change.
Language: TypeScript
File: frontend/taipy-gui/src/components/Taipy/Chat.spec.tsx
PR Title: Implemented image upload on Chat
BEFORE CODE: await userEvent.click(elt);
await userEvent.keyboard("new message");
await userEvent.click(getByRole("button",{ name: /sen... | create before test
and reset after test | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
*/
import React, {
useMemo,
useCallback,
KeyboardEvent,
MouseEvent,
useState,
useRef,
useEffect,
ReactNode,
lazy,
} from "react";
import { SxProps, Theme, darken, lighten } from "@mui/material/styles";
import Avatar from "@mui/material/Avatar";
import Box from "@mui/material/Box";
... | Coding rules: separate imports for better tree shaking | */
import React, {
useMemo,
useCallback,
KeyboardEvent,
MouseEvent,
useState,
useRef,
useEffect,
ReactNode,
lazy,
} from "react";
import { SxProps, Theme, darken, lighten } from "@mui/material/styles";
import Avatar from "@mui/material/Avatar";
import Box from "@mui/material/Box";
... | @@ -34,7 +34,7 @@ import Paper from "@mui/material/Paper";
import Popper from "@mui/material/Popper";
import TextField from "@mui/material/TextField";
import Tooltip from "@mui/material/Tooltip";
-import Send from "@mui/icons-material/Send";
+import {Send, AttachFile} from "@mui/icons-material"; | frontend/taipy-gui/src/components/Taipy/Chat.tsx | 26 | TypeScript | 0.286 | suggestion | 54 | 51 | 51 | false | Implemented image upload on Chat | 2,078 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | Satoshi-Sh | Review this pull request change.
Language: TypeScript
File: frontend/taipy-gui/src/components/Taipy/Chat.tsx
PR Title: Implemented image upload on Chat
BEFORE CODE: */
import React, {
useMemo,
useCallback,
KeyboardEvent,
MouseEvent,
useState,
useRef,
useEffect,
ReactNode,
lazy,... | Coding rules: separate imports for better tree shaking | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
attributes=attrs,
)
.set_value_and_default(with_update=False)
.set_attributes(
[
("on_action", PropertyType.function),
("active", PropertyType.dynamic_boolean, True),
("hover_text", PropertyType.dynamic_string),
... | 50MB seems a lot?
I'd say 1MB seems right. | attributes=attrs,
)
.set_value_and_default(with_update=False)
.set_attributes(
[
("on_action", PropertyType.function),
("active", PropertyType.dynamic_boolean, True),
("hover_text", PropertyType.dynamic_string),
... | @@ -99,6 +99,7 @@ class _Factory:
("sender_id",),
("height",),
("page_size", PropertyType.number, 50),
+ ("max_file_size", PropertyType.number, 50 * 1024 * 1024), | taipy/gui/_renderers/factory.py | 26 | Python | 0.071 | suggestion | 42 | 51 | 51 | false | Implemented image upload on Chat | 2,078 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | Satoshi-Sh | Review this pull request change.
Language: Python
File: taipy/gui/_renderers/factory.py
PR Title: Implemented image upload on Chat
BEFORE CODE: attributes=attrs,
)
.set_value_and_default(with_update=False)
.set_attributes(
[
("on_action", PropertyType.... | 50MB seems a lot?
I'd say 1MB seems right. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
? val
: val.toLowerCase()
: val
: colType === "number"
? parseFloat(val)
: colType === "boolean"
? val === "1"
... | I would set it to false by default.
What do you think @FabienLelaquais ? | : colType === "boolean"
? val === "1"
: colType === "date"
? getDateTime(val)
: val
: val,
type: colType,
matchCase: !!match... | @@ -126,44 +139,56 @@ const FilterRow = (props: FilterRowProps) => {
const [colId, setColId] = useState<string>("");
const [action, setAction] = useState<string>("");
const [val, setVal] = useState<string>("");
+ const [matchCase, setMatchCase] = useState<boolean>(true); // Case-sensitivity state | frontend/taipy-gui/src/components/Taipy/TableFilter.tsx | 26 | TypeScript | 0.214 | question | 73 | 51 | 51 | false | #426 case insensitive filtering | 2,087 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | Rishi-0007 | Review this pull request change.
Language: TypeScript
File: frontend/taipy-gui/src/components/Taipy/TableFilter.tsx
PR Title: #426 case insensitive filtering
BEFORE CODE: ? val
: val.toLowerCase()
: val
... | I would set it to false by default.
What do you think @FabienLelaquais ? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const [matchCase, setMatchCase] = useState<boolean>(true); // Case-sensitivity state
const [enableCheck, setEnableCheck] = useState(false);
const [enableDel, setEnableDel] = useState(false);
// Function to handle case-sensitivity toggle
const toggleMatchCase = () => setMatchCase(!matchCase);
c... | no need for that the comparison is done on the backend | // Function to handle case-sensitivity toggle
const toggleMatchCase = useCallback(() => {
setMatchCase((prev) => !prev);
}, []);
const onColSelect = useCallback(
(e: SelectChangeEvent<string>) => {
setColId(e.target.value);
setEnableCheck(!!getFilterDesc(columns,... | @@ -126,44 +139,56 @@ const FilterRow = (props: FilterRowProps) => {
const [colId, setColId] = useState<string>("");
const [action, setAction] = useState<string>("");
const [val, setVal] = useState<string>("");
+ const [matchCase, setMatchCase] = useState<boolean>(true); // Case-sensitivity state
... | frontend/taipy-gui/src/components/Taipy/TableFilter.tsx | 26 | TypeScript | 0.214 | suggestion | 54 | 51 | 51 | false | #426 case insensitive filtering | 2,087 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | Rishi-0007 | Review this pull request change.
Language: TypeScript
File: frontend/taipy-gui/src/components/Taipy/TableFilter.tsx
PR Title: #426 case insensitive filtering
BEFORE CODE: const [matchCase, setMatchCase] = useState<boolean>(true); // Case-sensitivity state
const [enableCheck, setEnableCheck] = useState(false... | no need for that the comparison is done on the backend | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
// Function to handle case-sensitivity toggle
const toggleMatchCase = () => setMatchCase(!matchCase);
const onColSelect = useCallback(
(e: SelectChangeEvent<string>) => {
setColId(e.target.value);
setEnableCheck(!!getFilterDesc(columns, e.target.value, action, val, matchCase... | no need for the new dependency |
const onColSelect = useCallback(
(e: SelectChangeEvent<string>) => {
setColId(e.target.value);
setEnableCheck(!!getFilterDesc(columns, e.target.value, action, val));
},
[columns, action, val]
);
const onActSelect = useCallback(
(e: SelectChangeEvent<... | @@ -126,44 +139,56 @@ const FilterRow = (props: FilterRowProps) => {
const [colId, setColId] = useState<string>("");
const [action, setAction] = useState<string>("");
const [val, setVal] = useState<string>("");
+ const [matchCase, setMatchCase] = useState<boolean>(true); // Case-sensitivity state
... | frontend/taipy-gui/src/components/Taipy/TableFilter.tsx | 26 | TypeScript | 0.071 | suggestion | 30 | 51 | 51 | false | #426 case insensitive filtering | 2,087 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | Rishi-0007 | Review this pull request change.
Language: TypeScript
File: frontend/taipy-gui/src/components/Taipy/TableFilter.tsx
PR Title: #426 case insensitive filtering
BEFORE CODE: // Function to handle case-sensitivity toggle
const toggleMatchCase = () => setMatchCase(!matchCase);
const onColSelect = useCallbac... | no need for the new dependency | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const { idx, setFilter, columns, colsOrder, filter } = props;
const [colId, setColId] = useState<string>("");
const [action, setAction] = useState<string>("");
const [val, setVal] = useState<string>("");
const [matchCase, setMatchCase] = useState<boolean>(true); // Case-sensitivity state
const ... | no need for the new dependency
| const [val, setVal] = useState<string>("");
const [matchCase, setMatchCase] = useState<boolean>(false);
const [enableCheck, setEnableCheck] = useState(false);
const [enableDel, setEnableDel] = useState(false);
// Function to handle case-sensitivity toggle
const toggleMatchCase = useCallback(() ... | @@ -126,44 +139,56 @@ const FilterRow = (props: FilterRowProps) => {
const [colId, setColId] = useState<string>("");
const [action, setAction] = useState<string>("");
const [val, setVal] = useState<string>("");
+ const [matchCase, setMatchCase] = useState<boolean>(true); // Case-sensitivity state
... | frontend/taipy-gui/src/components/Taipy/TableFilter.tsx | 26 | TypeScript | 0.071 | suggestion | 32 | 51 | 51 | false | #426 case insensitive filtering | 2,087 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | Rishi-0007 | Review this pull request change.
Language: TypeScript
File: frontend/taipy-gui/src/components/Taipy/TableFilter.tsx
PR Title: #426 case insensitive filtering
BEFORE CODE: const { idx, setFilter, columns, colsOrder, filter } = props;
const [colId, setColId] = useState<string>("");
const [action, setActi... | no need for the new dependency
| You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
} as FilterDesc;
} catch (e) {
console.info("could not parse value ", val, e);
}
}
};
const FilterRow = (props: FilterRowProps) => {
const { idx, setFilter, columns, colsOrder, filter } = props;
const [colId, setColId] = useState<string>("");
const [action, setA... | no need for the new dependency | }
};
const FilterRow = (props: FilterRowProps) => {
const { idx, setFilter, columns, colsOrder, filter } = props;
const [colId, setColId] = useState<string>("");
const [action, setAction] = useState<string>("");
const [val, setVal] = useState<string>("");
const [matchCase, setMatchCase] = useS... | @@ -126,44 +139,56 @@ const FilterRow = (props: FilterRowProps) => {
const [colId, setColId] = useState<string>("");
const [action, setAction] = useState<string>("");
const [val, setVal] = useState<string>("");
+ const [matchCase, setMatchCase] = useState<boolean>(true); // Case-sensitivity state
... | frontend/taipy-gui/src/components/Taipy/TableFilter.tsx | 26 | TypeScript | 0.071 | suggestion | 30 | 51 | 51 | false | #426 case insensitive filtering | 2,087 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | Rishi-0007 | Review this pull request change.
Language: TypeScript
File: frontend/taipy-gui/src/components/Taipy/TableFilter.tsx
PR Title: #426 case insensitive filtering
BEFORE CODE: } as FilterDesc;
} catch (e) {
console.info("could not parse value ", val, e);
}
}
};
const FilterRo... | no need for the new dependency | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
onChange={onValueAutoComp}
renderInput={(params) => (
<TextField
{...params}
className="MuiAutocomplete-inputRootDense"
label={`${val ? "" : "Empty ... | don't like the data-testid
give it a classname | label={`${val ? "" : "Empty "}String`}
margin="dense"
/>
)}
sx={autocompleteSx}
/>
) : (
<TextField
... | @@ -283,6 +310,17 @@ const FilterRow = (props: FilterRowProps) => {
/>
)}
</Grid>
+
+ {/* Case Sensitivity Toggle */}
+ <Grid size={3}>
+ <FormControlLabel
+ control={
+ <Switch checked={mat... | frontend/taipy-gui/src/components/Taipy/TableFilter.tsx | 26 | TypeScript | 0.071 | suggestion | 47 | 51 | 51 | false | #426 case insensitive filtering | 2,087 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | Rishi-0007 | Review this pull request change.
Language: TypeScript
File: frontend/taipy-gui/src/components/Taipy/TableFilter.tsx
PR Title: #426 case insensitive filtering
BEFORE CODE: onChange={onValueAutoComp}
renderInput={(params) => (
<TextField
... | don't like the data-testid
give it a classname | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
columns.append(_PandasDataAccessor.__INDEX_COL)
fullrowcount = len(df)
# filtering
filters = payload.get("filters")
if isinstance(filters, list) and len(filters) > 0:
query = ""
vars = []
for fd in filters:
col = fd.get... | we want this to work for **any** action | columns.append(_PandasDataAccessor.__INDEX_COL)
fullrowcount = len(df)
# filtering
filters = payload.get("filters")
if isinstance(filters, list) and len(filters) > 0:
query = ""
vars = []
for fd in filters:
col = fd.get... | @@ -267,12 +267,22 @@ def __get_data( # noqa: C901
col = fd.get("col")
val = fd.get("value")
action = fd.get("action")
+ match_case = fd.get("matchCase", True) # Retrieve matchCase from the frontend payload
+
if isinsta... | taipy/gui/data/pandas_data_accessor.py | 26 | Python | 0.071 | suggestion | 39 | 51 | 51 | false | #426 case insensitive filtering | 2,087 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | Rishi-0007 | Review this pull request change.
Language: Python
File: taipy/gui/data/pandas_data_accessor.py
PR Title: #426 case insensitive filtering
BEFORE CODE: columns.append(_PandasDataAccessor.__INDEX_COL)
fullrowcount = len(df)
# filtering
filters = payload.get("filters")
i... | we want this to work for **any** action | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
/>
) : (
<TextField
value={val || ""}
onChange={onValueChange}
label={`${val ? "" : "Empty "}String`}
margin="dense"
/>
)}
... | I would add the icon only as an end Adornment to the AutoComplete and TextField within a MUi switch component
```jsx
<TextField ...
slotProps={{
input: {
endAdornment: (
<Switch
... | sx={autocompleteSx}
/>
) : (
<TextField
value={val || ""}
onChange={onValueChange}
label={`${val ? "" : "Empty "}String`}
margin="dense"
... | @@ -283,6 +304,17 @@ const FilterRow = (props: FilterRowProps) => {
/>
)}
</Grid>
+ | frontend/taipy-gui/src/components/Taipy/TableFilter.tsx | 26 | TypeScript | 0.857 | security | 826 | 51 | 51 | false | #426 case insensitive filtering | 2,087 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | Rishi-0007 | Review this pull request change.
Language: TypeScript
File: frontend/taipy-gui/src/components/Taipy/TableFilter.tsx
PR Title: #426 case insensitive filtering
BEFORE CODE: />
) : (
<TextField
value={val || ""}
onC... | I would add the icon only as an end Adornment to the AutoComplete and TextField within a MUi switch component
```jsx
<TextField ...
slotProps={{
input: {
endAdornment: (
<Switch
... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
columns = [c[len(col_prefix) :] if c.startswith(col_prefix) else c for c in columns]
ret_payload = {"pagekey": payload.get("pagekey", "unknown page")}
paged = not payload.get("alldata", False)
is_copied = False
orig_df = df
# add index if not chart
if paged:
... | Why did you remove these lines about date col ? | columns = [c[len(col_prefix) :] if c.startswith(col_prefix) else c for c in columns]
ret_payload = {"pagekey": payload.get("pagekey", "unknown page")}
paged = not payload.get("alldata", False)
is_copied = False
orig_df = df
# add index if not chart
if paged:
... | @@ -267,12 +267,21 @@ def __get_data( # noqa: C901
col = fd.get("col")
val = fd.get("value")
action = fd.get("action")
+ match_case = fd.get("matchCase", False)
+
if isinstance(val, str):
- if self.__is_date_column(t.... | taipy/gui/data/pandas_data_accessor.py | 26 | Python | 0.143 | question | 47 | 51 | 51 | false | #426 case insensitive filtering | 2,087 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | Rishi-0007 | Review this pull request change.
Language: Python
File: taipy/gui/data/pandas_data_accessor.py
PR Title: #426 case insensitive filtering
BEFORE CODE: columns = [c[len(col_prefix) :] if c.startswith(col_prefix) else c for c in columns]
ret_payload = {"pagekey": payload.get("pagekey", "unknown pag... | Why did you remove these lines about date col ? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
is_copied = False
orig_df = df
# add index if not chart
if paged:
if _PandasDataAccessor.__INDEX_COL not in df.columns:
is_copied = True
df = df.assign(**{_PandasDataAccessor.__INDEX_COL: df.index})
if columns and _PandasDataAccess... | you're still not dealing with string comparison (not contains) and matchcase | is_copied = False
orig_df = df
# add index if not chart
if paged:
if _PandasDataAccessor.__INDEX_COL not in df.columns:
is_copied = True
df = df.assign(**{_PandasDataAccessor.__INDEX_COL: df.index})
if columns and _PandasDataAccess... | @@ -267,12 +267,21 @@ def __get_data( # noqa: C901
col = fd.get("col")
val = fd.get("value")
action = fd.get("action")
+ match_case = fd.get("matchCase", False)
+
if isinstance(val, str):
- if self.__is_date_column(t.... | taipy/gui/data/pandas_data_accessor.py | 26 | Python | 0.214 | suggestion | 76 | 51 | 51 | false | #426 case insensitive filtering | 2,087 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | Rishi-0007 | Review this pull request change.
Language: Python
File: taipy/gui/data/pandas_data_accessor.py
PR Title: #426 case insensitive filtering
BEFORE CODE: is_copied = False
orig_df = df
# add index if not chart
if paged:
if _PandasDataAccessor.__INDEX_COL not in df.columns:
... | you're still not dealing with string comparison (not contains) and matchcase | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
paged = not payload.get("alldata", False)
is_copied = False
orig_df = df
# add index if not chart
if paged:
if _PandasDataAccessor.__INDEX_COL not in df.columns:
is_copied = True
df = df.assign(**{_PandasDataAccessor.__INDEX_COL: df.in... | we should test is date column only if val is a string | paged = not payload.get("alldata", False)
is_copied = False
orig_df = df
# add index if not chart
if paged:
if _PandasDataAccessor.__INDEX_COL not in df.columns:
is_copied = True
df = df.assign(**{_PandasDataAccessor.__INDEX_COL: df.in... | @@ -269,25 +269,46 @@ def __get_data( # noqa: C901
action = fd.get("action")
match_case = fd.get("matchCase", False)
- if isinstance(val, str):
+ # Handle date columns separately from query
+ if self.__is_date_column(t.cast(pd.DataFrame, ... | taipy/gui/data/pandas_data_accessor.py | 26 | Python | 0.286 | suggestion | 53 | 51 | 51 | false | #426 case insensitive filtering | 2,087 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | Rishi-0007 | Review this pull request change.
Language: Python
File: taipy/gui/data/pandas_data_accessor.py
PR Title: #426 case insensitive filtering
BEFORE CODE: paged = not payload.get("alldata", False)
is_copied = False
orig_df = df
# add index if not chart
if paged:
if _P... | we should test is date column only if val is a string | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
if isinstance(filters, list) and len(filters) > 0:
query = ""
vars = []
for fd in filters:
col = fd.get("col")
val = fd.get("value")
action = fd.get("action")
match_case = fd.get("matchCase", False)
... | please re-use code and do not duplicate | if isinstance(filters, list) and len(filters) > 0:
query = ""
vars = []
for fd in filters:
col = fd.get("col")
val = fd.get("value")
action = fd.get("action")
match_case = fd.get("matchCase", False) is not False ... | @@ -269,25 +269,46 @@ def __get_data( # noqa: C901
action = fd.get("action")
match_case = fd.get("matchCase", False)
- if isinstance(val, str):
+ # Handle date columns separately from query
+ if self.__is_date_column(t.cast(pd.DataFrame, ... | taipy/gui/data/pandas_data_accessor.py | 26 | Python | 0.143 | refactor | 39 | 51 | 51 | false | #426 case insensitive filtering | 2,087 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | Rishi-0007 | Review this pull request change.
Language: Python
File: taipy/gui/data/pandas_data_accessor.py
PR Title: #426 case insensitive filtering
BEFORE CODE: if isinstance(filters, list) and len(filters) > 0:
query = ""
vars = []
for fd in filters:
col = fd.get("c... | please re-use code and do not duplicate | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
paged = not payload.get("alldata", False)
is_copied = False
orig_df = df
# add index if not chart
if paged:
if _PandasDataAccessor.__INDEX_COL not in df.columns:
is_copied = True
df = df.assign(**{_PandasDataAccessor.__INDEX_COL: df.in... | why do you change the previous code that was working ?
We want to build a query and apply it once.
the previous code
```py
if isinstance(val, str):
if self.__is_date_column(t.cast(pd.DataFrame, df), col):
val = datetime.fromisoformat(val[:-1])
... | paged = not payload.get("alldata", False)
is_copied = False
orig_df = df
# add index if not chart
if paged:
if _PandasDataAccessor.__INDEX_COL not in df.columns:
is_copied = True
df = df.assign(**{_PandasDataAccessor.__INDEX_COL: df.in... | @@ -267,18 +267,47 @@ def __get_data( # noqa: C901
col = fd.get("col")
val = fd.get("value")
action = fd.get("action")
- if isinstance(val, str):
- if self.__is_date_column(t.cast(pd.DataFrame, df), col):
- val ... | taipy/gui/data/pandas_data_accessor.py | 26 | Python | 1 | question | 1,378 | 51 | 51 | false | #426 case insensitive filtering | 2,087 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | Rishi-0007 | Review this pull request change.
Language: Python
File: taipy/gui/data/pandas_data_accessor.py
PR Title: #426 case insensitive filtering
BEFORE CODE: paged = not payload.get("alldata", False)
is_copied = False
orig_df = df
# add index if not chart
if paged:
if _P... | why do you change the previous code that was working ?
We want to build a query and apply it once.
the previous code
```py
if isinstance(val, str):
if self.__is_date_column(t.cast(pd.DataFrame, df), col):
val = datetime.fromisoformat(val[:-1])
... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { SvgIcon, SvgIconProps } from "@mui/material";
export const MatchCase = (props: SvgIconProps) => (
<SvgIcon {...props} viewBox="0 0 16 16">
<g stroke="currentColor">
<path d="M20 14c0-1.5-.5-2-2-2h-2v-1c0-1 0-1-2-1v9h4c1.5 0 2-.53 2-2zm-8-2c0-1.5-.53-2-2-2H6c-1.5 0-2 .5-2 2v7h2v-3h4v3h2... | `import SvgIcon, { SvgIconProps } from "@mui/material/SvgIcon";` for better tree shaking | /*
* Copyright 2021-2024 Avaiga Private Limited
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable l... | @@ -0,0 +1,9 @@
+import { SvgIcon, SvgIconProps } from "@mui/material"; | frontend/taipy-gui/src/components/icons/MatchCase.tsx | 1 | TypeScript | 0.429 | suggestion | 88 | 10 | 24 | false | #426 case insensitive filtering | 2,087 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | Rishi-0007 | Review this pull request change.
Language: TypeScript
File: frontend/taipy-gui/src/components/icons/MatchCase.tsx
PR Title: #426 case insensitive filtering
BEFORE CODE: import { SvgIcon, SvgIconProps } from "@mui/material";
export const MatchCase = (props: SvgIconProps) => (
<SvgIcon {...props} viewBox="0 0 16... | `import SvgIcon, { SvgIconProps } from "@mui/material/SvgIcon";` for better tree shaking | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
*/
import React, { ChangeEvent, SyntheticEvent, useCallback, useEffect, useMemo, useRef, useState } from "react";
import Autocomplete from "@mui/material/Autocomplete";
import CheckIcon from "@mui/icons-material/Check";
import DeleteIcon from "@mui/icons-material/Delete";
import FilterListIcon from "@mui/icons-materi... | use current coding rules : specific import for better tree shaking
```
import FormControlLabel from "@mui/material/FormControlLabel";
import Switch from "@mui/material/Switch";
``` | */
import React, { ChangeEvent, SyntheticEvent, useCallback, useEffect, useMemo, useRef, useState } from "react";
import Autocomplete from "@mui/material/Autocomplete";
import CheckIcon from "@mui/icons-material/Check";
import DeleteIcon from "@mui/icons-material/Delete";
import FilterListIcon from "@mui/icons-materi... | @@ -33,6 +33,9 @@ import { AdapterDateFns } from "@mui/x-date-pickers/AdapterDateFnsV3";
import { ColumnDesc, defaultDateFormat, getSortByIndex, iconInRowSx, FilterDesc } from "./tableUtils";
import { getDateTime, getTypeFromDf } from "../../utils";
import { getSuffixedClassNames } from "./utils";
+import SvgIcon fr... | frontend/taipy-gui/src/components/Taipy/TableFilter.tsx | 26 | TypeScript | 0.786 | suggestion | 186 | 51 | 51 | false | #426 case insensitive filtering | 2,087 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | Rishi-0007 | Review this pull request change.
Language: TypeScript
File: frontend/taipy-gui/src/components/Taipy/TableFilter.tsx
PR Title: #426 case insensitive filtering
BEFORE CODE: */
import React, { ChangeEvent, SyntheticEvent, useCallback, useEffect, useMemo, useRef, useState } from "react";
import Autocomplete from "@mu... | use current coding rules : specific import for better tree shaking
```
import FormControlLabel from "@mui/material/FormControlLabel";
import Switch from "@mui/material/Switch";
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
">=": "after equal",
">": "after",
},
} as Record<string, Record<string, string>>;
const gridSx = { p: "0.5em", minWidth: "36rem" };
const autocompleteSx = { "& .MuiInputBase-root": { padding: "0" } };
const badgeSx = {
"& .MuiBadge-badge": {
height: "10px",
minWidth: "10px",
... | remove this
If we don't use it, it *is* an error ? | ">=": "after equal",
">": "after",
},
} as Record<string, Record<string, string>>;
const gridSx = { p: "0.5em", minWidth: "36rem" };
const autocompleteSx = { "& .MuiInputBase-root": { padding: "0" } };
const badgeSx = {
"& .MuiBadge-badge": {
height: "10px",
minWidth: "10px",
... | @@ -92,7 +94,14 @@ const getActionsByType = (colType?: string) =>
(colType && colType in actionsByType && actionsByType[colType]) ||
(colType === "any" ? { ...actionsByType.string, ...actionsByType.number } : actionsByType.string);
-const getFilterDesc = (columns: Record<string, ColumnDesc>, colId?: string,... | frontend/taipy-gui/src/components/Taipy/TableFilter.tsx | 26 | TypeScript | 0.429 | refactor | 53 | 51 | 51 | false | #426 case insensitive filtering | 2,087 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | Rishi-0007 | Review this pull request change.
Language: TypeScript
File: frontend/taipy-gui/src/components/Taipy/TableFilter.tsx
PR Title: #426 case insensitive filtering
BEFORE CODE: ">=": "after equal",
">": "after",
},
} as Record<string, Record<string, string>>;
const gridSx = { p: "0.5em", minWidth: "3... | remove this
If we don't use it, it *is* an error ? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import typing as t
from .. import Gui, State
from ..utils import _MapDict
class MockState(State):
"""A Mock implementation for `State`.
TODO
example of use:
```py
def test_callback():
ms = MockState(Gui(""), a = 1)
on_action(ms) # function to test
assert ms.a == 2
```
... | ```suggestion
def get_gui(self) -> Gui:
``` | import typing as t
from .. import Gui, State
from ..utils import _MapDict
class MockState(State):
"""A Mock implementation for `State`.
TODO
example of use:
```py
def test_callback():
ms = MockState(Gui(""), a = 1)
on_action(ms) # function to test
assert ms.a == 2
```
... | @@ -0,0 +1,62 @@
+# Copyright 2021-2024 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required b... | taipy/gui/mock/mock_state.py | 26 | Python | 0.429 | suggestion | 49 | 51 | 51 | false | Adding a mock State class that can be instantiated and queried while testing | 2,101 | Avaiga/taipy | 12,680 | Python | FabienLelaquais | FredLL-Avaiga | Review this pull request change.
Language: Python
File: taipy/gui/mock/mock_state.py
PR Title: Adding a mock State class that can be instantiated and queried while testing
BEFORE CODE: import typing as t
from .. import Gui, State
from ..utils import _MapDict
class MockState(State):
"""A Mock implementation f... | ```suggestion
def get_gui(self) -> Gui:
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
def __init__(self, gui: Gui, **kwargs) -> None:
super().__setattr__(MockState.__VARS, {k: _MapDict(v) if isinstance(v, dict) else v for k, v in kwargs.items()})
self._gui = gui
super().__init__()
def get_gui(self) -> "Gui":
return self._gui
def __getattribute__(self, name:... | Doesn't this prevent MockState to be used as a context manager?
The tests seems to respond no... |
def __init__(self, gui: Gui, **kwargs) -> None:
super().__setattr__(MockState.__VARS, {k: _MapDict(v) if isinstance(v, dict) else v for k, v in kwargs.items()})
self._gui = gui
super().__init__()
def get_gui(self) -> Gui:
return self._gui
def __getattribute__(self, name: s... | @@ -0,0 +1,62 @@
+# Copyright 2021-2024 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required b... | taipy/gui/mock/mock_state.py | 26 | Python | 0.286 | question | 97 | 34 | 34 | false | Adding a mock State class that can be instantiated and queried while testing | 2,101 | Avaiga/taipy | 12,680 | Python | FabienLelaquais | FredLL-Avaiga | Review this pull request change.
Language: Python
File: taipy/gui/mock/mock_state.py
PR Title: Adding a mock State class that can be instantiated and queried while testing
BEFORE CODE:
def __init__(self, gui: Gui, **kwargs) -> None:
super().__setattr__(MockState.__VARS, {k: _MapDict(v) if isinstance(v,... | Doesn't this prevent MockState to be used as a context manager?
The tests seems to respond no... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
id: str,
default_path: Optional[str] = None,
engine: Optional[str] = None,
compression: Optional[str] = None,
read_kwargs: Optional[Dict] = None,
write_kwargs: Optional[Dict] = None,
exposed_type: Optional[str] = None,
scope: Optional[Scope] = None,
... | @FlorianJacta, I think this is not required. Maybe you changed it by mistake? | id: str,
default_path: Optional[str] = None,
engine: Optional[str] = None,
compression: Optional[str] = None,
read_kwargs: Optional[Dict] = None,
write_kwargs: Optional[Dict] = None,
exposed_type: Optional[str] = None,
scope: Optional[Scope] = None,
... | @@ -508,8 +508,8 @@ class Config:
function.
write_kwargs (Optional[dict]): Additional parameters passed to the
`pandas.DataFrame.write_parquet()` function.<br/>
- The parameters in *read_kwargs* and *write_kwargs* have a **higher precedence**
- ... | taipy/common/config/config.pyi | 26 | Python | 0.286 | question | 77 | 51 | 51 | false | Fix dead links in ReadMe | 2,110 | Avaiga/taipy | 12,680 | Python | rohitdash08 | FlorianJacta | Review this pull request change.
Language: Python
File: taipy/common/config/config.pyi
PR Title: Fix dead links in ReadMe
BEFORE CODE: id: str,
default_path: Optional[str] = None,
engine: Optional[str] = None,
compression: Optional[str] = None,
read_kwargs: Optional[Dict] = N... | @FlorianJacta, I think this is not required. Maybe you changed it by mistake? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}
} catch (error) {
console.error(error);
}
}, [props.date, tz, withTime, max, min]);
return (
<ErrorBoundary FallbackComponent={ErrorFallback}>
<Tooltip title={hover || ""}>
<Box id={id} className={`${className} ${getComponentClassNam... | apply the ternary operator (analogic ? ...) at the viewRenderers property level
`viewRenderers={analogic ? analogicRenderers : undefined}`
With analogicRenderers defined outside the component | if (min !== undefined) {
setStartProps((p) => getProps(p, true, getDateTime(min, tz, withTime), withTime));
}
if (max !== undefined) {
setEndProps((p) => getProps(p, false, getDateTime(max, tz, withTime), withTime));
}
} catch (err... | @@ -109,18 +115,38 @@ const DateSelector = (props: DateSelectorProps) => {
<Box id={id} className={`${className} ${getComponentClassName(props.children)}`} sx={boxSx}>
{editable ? (
withTime ? (
- <DateTimePicker
- ... | frontend/taipy-gui/src/components/Taipy/DateSelector.tsx | 26 | TypeScript | 0.643 | suggestion | 196 | 51 | 51 | false | Analogic for date component | 2,115 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | Tryxns | Review this pull request change.
Language: TypeScript
File: frontend/taipy-gui/src/components/Taipy/DateSelector.tsx
PR Title: Analogic for date component
BEFORE CODE: }
} catch (error) {
console.error(error);
}
}, [props.date, tz, withTime, max, min]);
return (
... | apply the ternary operator (analogic ? ...) at the viewRenderers property level
`viewRenderers={analogic ? analogicRenderers : undefined}`
With analogicRenderers defined outside the component | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
updateVarName,
[
start
? dateToString(newDate, withTime)
: otherDate && dateToString(otherDate, withTime),
start
... | outside the component ? ie before line 70 | const newDate = getTimeZonedDate(v, tz, withTime);
const otherDate = start
? dates[1] && getTimeZonedDate(dates[1], tz, withTime)
: dates[0] && getTimeZonedDate(dates[0], tz, withTime);
dispatch(
... | @@ -117,6 +119,11 @@ const DateRange = (props: DateRangeProps) => {
const handleChangeStart = useCallback((v: Date | null) => handleChange(v, true), [handleChange]);
const handleChangeEnd = useCallback((v: Date | null) => handleChange(v, false), [handleChange]);
+ const analogicRenderers = { | frontend/taipy-gui/src/components/Taipy/DateRange.tsx | 26 | TypeScript | 0.071 | suggestion | 41 | 51 | 51 | false | Analogic for daterange | 2,116 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | Tryxns | Review this pull request change.
Language: TypeScript
File: frontend/taipy-gui/src/components/Taipy/DateRange.tsx
PR Title: Analogic for daterange
BEFORE CODE: updateVarName,
[
start
? dateToS... | outside the component ? ie before line 70 | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
"metavar": "UPLOAD_FOLDER",
"nargs": "?",
"default": "",
"const": "",
"help": "The path to the folder where uploaded files from Taipy GUI will be stored.",
},
}
__DEBUG_ARGS: Dict[str, Dict] = {
"--debug": {"dest": "taipy_debug", "help... | can we not use the same `dest` with action: `store_false` ? | "metavar": "UPLOAD_FOLDER",
"nargs": "?",
"default": "",
"const": "",
"help": "The path to the folder where uploaded files from Taipy GUI will be stored.",
},
}
__DEBUG_ARGS: Dict[str, Dict] = {
"--debug": {"dest": "taipy_debug", "help... | @@ -81,21 +81,55 @@ class _GuiCLI(_AbstractCLI):
"--no-reloader": {"dest": "taipy_no_reloader", "help": "No reload on code changes", "action": "store_true"},
}
+ __BROWSER_ARGS: Dict[str, Dict] = {
+ "--run-browser": {
+ "dest": "taipy_run_browser",
+ "help": "Open a new ... | taipy/gui/_gui_cli.py | 26 | Python | 0.429 | question | 59 | 51 | 51 | false | Add command line options for run_browser and dark_mode Gui.run() parameters | 2,128 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | FabienLelaquais | Review this pull request change.
Language: Python
File: taipy/gui/_gui_cli.py
PR Title: Add command line options for run_browser and dark_mode Gui.run() parameters
BEFORE CODE: "metavar": "UPLOAD_FOLDER",
"nargs": "?",
"default": "",
"const": "",
"help": "... | can we not use the same `dest` with action: `store_false` ? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
"--debug": {"dest": "taipy_debug", "help": "Turn on debug", "action": "store_true"},
"--no-debug": {"dest": "taipy_no_debug", "help": "Turn off debug", "action": "store_true"},
}
__RELOADER_ARGS: Dict[str, Dict] = {
"--use-reloader": {"dest": "taipy_use_reloader", "help": "Auto reload o... | Maybe Apply dark mode and removing the 'the' is enough | "--debug": {"dest": "taipy_debug", "help": "Turn on debug", "action": "store_true"},
"--no-debug": {"dest": "taipy_no_debug", "help": "Turn off debug", "action": "store_true"},
}
__RELOADER_ARGS: Dict[str, Dict] = {
"--use-reloader": {"dest": "taipy_use_reloader", "help": "Auto reload o... | @@ -81,21 +81,55 @@ class _GuiCLI(_AbstractCLI):
"--no-reloader": {"dest": "taipy_no_reloader", "help": "No reload on code changes", "action": "store_true"},
}
+ __BROWSER_ARGS: Dict[str, Dict] = {
+ "--run-browser": {
+ "dest": "taipy_run_browser",
+ "help": "Open a new ... | taipy/gui/_gui_cli.py | 26 | Python | 0.214 | suggestion | 54 | 51 | 51 | false | Add command line options for run_browser and dark_mode Gui.run() parameters | 2,128 | Avaiga/taipy | 12,680 | Python | dinhlongviolin1 | FabienLelaquais | Review this pull request change.
Language: Python
File: taipy/gui/_gui_cli.py
PR Title: Add command line options for run_browser and dark_mode Gui.run() parameters
BEFORE CODE: "--debug": {"dest": "taipy_debug", "help": "Turn on debug", "action": "store_true"},
"--no-debug": {"dest": "taipy_no_debug... | Maybe Apply dark mode and removing the 'the' is enough | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
def __load_version_from_path(base_path: str) -> Version:
"""Load version.json file from base path."""
with open(os.path.join(base_path, "version.json")) as version_file:
data = json.load(version_file)
return Version(**data)
def __write_version_to_path(base_path: str, version: Version) -> None... | These 2 consecutive prints look strange to me. Can you double-check?
|
def __load_version_from_path(base_path: str) -> Version:
"""Load version.json file from base path."""
with open(os.path.join(base_path, "version.json")) as version_file:
data = json.load(version_file)
return Version(**data)
def __write_version_to_path(base_path: str, version: Version) -> None... | @@ -79,10 +79,12 @@ def __setup_dev_version(version: Version, _base_path: str, name: Optional[str] =
name = f"{name}_VERSION" if name else "VERSION"
print(f"{name}={version.dev_name}") # noqa: T201
- version.bump_ext_version()
+ print(f"NEW_{name}={version.dev_name}") # noqa: T201 | tools/release/setup_version.py | 26 | Python | 0.214 | question | 70 | 51 | 51 | false | Modify Release Action to Bump development versions and create a PR | 2,139 | Avaiga/taipy | 12,680 | Python | jrobinAV | joaoandre-avaiga | Review this pull request change.
Language: Python
File: tools/release/setup_version.py
PR Title: Modify Release Action to Bump development versions and create a PR
BEFORE CODE:
def __load_version_from_path(base_path: str) -> Version:
"""Load version.json file from base path."""
with open(os.path.join(base_... | These 2 consecutive prints look strange to me. Can you double-check?
| You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
name = f"{name}_VERSION" if name else "VERSION"
print(f"{name}={version.name}") # noqa: T201
if __name__ == "__main__":
paths = (
[sys.argv[1]]
if sys.argv[1] != "ALL"
else [
f"taipy{os.sep}common",
f"taipy{os.sep}core",
f"taipy{os.sep}rest",
... | It's not clear to me. Here is my understanding of the flow:
- We dev release using the version in the version.json files.
- We bump up the version and write the version.json files
- We commit and push the changes
If this is correct, I don't get why you changed the version before releasing.
| print(f"{name}={version.name}") # noqa: T201
if __name__ == "__main__":
paths = (
[sys.argv[1]]
if sys.argv[1] != "ALL"
else [
f"taipy{os.sep}common",
f"taipy{os.sep}core",
f"taipy{os.sep}rest",
f"taipy{os.sep}gui",
f"taipy{o... | @@ -119,6 +121,7 @@ def __setup_prod_version(version: Version, target_version: str, branch_name: str
if _environment == "dev":
__setup_dev_version(_version, _path, _name)
+ bump_ext_version(_version, _path) | tools/release/setup_version.py | 26 | Python | 0.5 | suggestion | 305 | 30 | 28 | false | Modify Release Action to Bump development versions and create a PR | 2,139 | Avaiga/taipy | 12,680 | Python | jrobinAV | joaoandre-avaiga | Review this pull request change.
Language: Python
File: tools/release/setup_version.py
PR Title: Modify Release Action to Bump development versions and create a PR
BEFORE CODE: name = f"{name}_VERSION" if name else "VERSION"
print(f"{name}={version.name}") # noqa: T201
if __name__ == "__main__":
path... | It's not clear to me. Here is my understanding of the flow:
- We dev release using the version in the version.json files.
- We bump up the version and write the version.json files
- We commit and push the changes
If this is correct, I don't get why you changed the version before releasing.
| You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const className = useClassNames(props.libClassName, props.dynamicClassName, props.className);
const baseLayout = useDynamicJsonProperty(props.layout, props.defaultLayout || "", emptyLayout);
const hover = useDynamicProperty(props.hoverText, props.defaultHoverText, undefined);
const theme = useTheme();
... | we want to keep support of "none" case insensitive | const className = useClassNames(props.libClassName, props.dynamicClassName, props.className);
const baseLayout = useDynamicJsonProperty(props.layout, props.defaultLayout || "", emptyLayout);
const hover = useDynamicProperty(props.hoverText, props.defaultHoverText, undefined);
const theme = useTheme();
... | @@ -87,7 +87,7 @@ const Metric = (props: MetricProps) => {
}, [props.colorMap, props.max]);
const data = useMemo(() => {
- const mode = props.type === "none" ? [] : ["gauge"];
+ const mode = props.type === null [] : ["gauge"]; | frontend/taipy-gui/src/components/Taipy/Metric.tsx | 26 | TypeScript | 0.214 | security | 50 | 51 | 51 | false | Metric: Add support for None | 2,147 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | codingis4noobs2 | Review this pull request change.
Language: TypeScript
File: frontend/taipy-gui/src/components/Taipy/Metric.tsx
PR Title: Metric: Add support for None
BEFORE CODE: const className = useClassNames(props.libClassName, props.dynamicClassName, props.className);
const baseLayout = useDynamicJsonProperty(props.lay... | we want to keep support of "none" case insensitive | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const className = useClassNames(props.libClassName, props.dynamicClassName, props.className);
const baseLayout = useDynamicJsonProperty(props.layout, props.defaultLayout || "", emptyLayout);
const hover = useDynamicProperty(props.hoverText, props.defaultHoverText, undefined);
const theme = useTheme();
... | As I wrote, I'd like it to be compared in a case insensitive way | const className = useClassNames(props.libClassName, props.dynamicClassName, props.className);
const baseLayout = useDynamicJsonProperty(props.layout, props.defaultLayout || "", emptyLayout);
const hover = useDynamicProperty(props.hoverText, props.defaultHoverText, undefined);
const theme = useTheme();
... | @@ -87,7 +87,7 @@ const Metric = (props: MetricProps) => {
}, [props.colorMap, props.max]);
const data = useMemo(() => {
- const mode = props.type === "none" ? [] : ["gauge"];
+ const mode = props.type === "none" || props.type == null ? [] : ["gauge"]; | frontend/taipy-gui/src/components/Taipy/Metric.tsx | 26 | TypeScript | 0.214 | security | 64 | 51 | 51 | false | Metric: Add support for None | 2,147 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | codingis4noobs2 | Review this pull request change.
Language: TypeScript
File: frontend/taipy-gui/src/components/Taipy/Metric.tsx
PR Title: Metric: Add support for None
BEFORE CODE: const className = useClassNames(props.libClassName, props.dynamicClassName, props.className);
const baseLayout = useDynamicJsonProperty(props.lay... | As I wrote, I'd like it to be compared in a case insensitive way | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const className = useClassNames(props.libClassName, props.dynamicClassName, props.className);
const baseLayout = useDynamicJsonProperty(props.layout, props.defaultLayout || "", emptyLayout);
const hover = useDynamicProperty(props.hoverText, props.defaultHoverText, undefined);
const theme = useTheme();
... | what if props.type is undefined ? | const className = useClassNames(props.libClassName, props.dynamicClassName, props.className);
const baseLayout = useDynamicJsonProperty(props.layout, props.defaultLayout || "", emptyLayout);
const hover = useDynamicProperty(props.hoverText, props.defaultHoverText, undefined);
const theme = useTheme();
... | @@ -87,7 +87,7 @@ const Metric = (props: MetricProps) => {
}, [props.colorMap, props.max]);
const data = useMemo(() => {
- const mode = props.type === "none" ? [] : ["gauge"];
+ const mode = props.type == null || props.type.toLowerCase() === "none" ? [] : ["gauge"]; | frontend/taipy-gui/src/components/Taipy/Metric.tsx | 26 | TypeScript | 0.214 | question | 33 | 51 | 51 | false | Metric: Add support for None | 2,147 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | codingis4noobs2 | Review this pull request change.
Language: TypeScript
File: frontend/taipy-gui/src/components/Taipy/Metric.tsx
PR Title: Metric: Add support for None
BEFORE CODE: const className = useClassNames(props.libClassName, props.dynamicClassName, props.className);
const baseLayout = useDynamicJsonProperty(props.lay... | what if props.type is undefined ? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const className = useClassNames(props.libClassName, props.dynamicClassName, props.className);
const baseLayout = useDynamicJsonProperty(props.layout, props.defaultLayout || "", emptyLayout);
const hover = useDynamicProperty(props.hoverText, props.defaultHoverText, undefined);
const theme = useTheme();
... | you need to declare type as string|null | const className = useClassNames(props.libClassName, props.dynamicClassName, props.className);
const baseLayout = useDynamicJsonProperty(props.layout, props.defaultLayout || "", emptyLayout);
const hover = useDynamicProperty(props.hoverText, props.defaultHoverText, undefined);
const theme = useTheme();
... | @@ -87,7 +87,7 @@ const Metric = (props: MetricProps) => {
}, [props.colorMap, props.max]);
const data = useMemo(() => {
- const mode = props.type === "none" ? [] : ["gauge"];
+ const mode = props.type == null || (typeof props.type === "string" && props.type.toLowerCase() === "none") ? [] : ["... | frontend/taipy-gui/src/components/Taipy/Metric.tsx | 26 | TypeScript | 0.214 | suggestion | 39 | 51 | 51 | false | Metric: Add support for None | 2,147 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | codingis4noobs2 | Review this pull request change.
Language: TypeScript
File: frontend/taipy-gui/src/components/Taipy/Metric.tsx
PR Title: Metric: Add support for None
BEFORE CODE: const className = useClassNames(props.libClassName, props.dynamicClassName, props.className);
const baseLayout = useDynamicJsonProperty(props.lay... | you need to declare type as string|null | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
});
});
it("applies style correctly when height is undefined", async () => {
const { container } = render(<Metric />);
await waitFor(() => {
const elt = container.querySelector(".js-plotly-plot");
expect(elt).toHaveStyle({
width: "100%",
... | I'd rather see None as it would be if the user specifies type=None in tgb | });
});
it("applies style correctly when height is undefined", async () => {
const { container } = render(<Metric />);
await waitFor(() => {
const elt = container.querySelector(".js-plotly-plot");
expect(elt).toHaveStyle({
width: "100%",
... | @@ -286,8 +286,18 @@ describe("Metric Component", () => {
});
});
- it("processes type prop correctly when type is none", async () => {
- const { container } = render(<Metric type="none" />);
+ it("processes type prop correctly when type is none (string)", async () => {
+ const { co... | frontend/taipy-gui/src/components/Taipy/Metric.spec.tsx | 26 | TypeScript | 0.429 | suggestion | 73 | 51 | 51 | false | Metric: Add support for None | 2,147 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | codingis4noobs2 | Review this pull request change.
Language: TypeScript
File: frontend/taipy-gui/src/components/Taipy/Metric.spec.tsx
PR Title: Metric: Add support for None
BEFORE CODE: });
});
it("applies style correctly when height is undefined", async () => {
const { container } = render(<Metric />);
... | I'd rather see None as it would be if the user specifies type=None in tgb | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
control_type=control_type,
element_name="Alert",
attributes=attrs,
)
.set_value_and_default(var_type=PropertyType.dynamic_string)
.set_attributes(
[
("severity", PropertyType.dynamic_string),
("variant", PropertyType... | no need for these to be dynamic (string is enough) | control_type=control_type,
element_name="Alert",
attributes=attrs,
)
.set_value_and_default(var_type=PropertyType.dynamic_string)
.set_attributes(
[
("severity", PropertyType.dynamic_string),
("variant", PropertyType... | @@ -99,6 +99,8 @@ class _Factory:
("active", PropertyType.dynamic_boolean, True),
("hover_text", PropertyType.dynamic_string),
("width", PropertyType.string_or_number),
+ ("size", PropertyType.dynamic_string), | taipy/gui/_renderers/factory.py | 26 | Python | 0.214 | suggestion | 50 | 51 | 51 | false | added more mui classes for buttons | 2,159 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | JeevaRamanathan | Review this pull request change.
Language: Python
File: taipy/gui/_renderers/factory.py
PR Title: added more mui classes for buttons
BEFORE CODE: control_type=control_type,
element_name="Alert",
attributes=attrs,
)
.set_value_and_default(var_type=PropertyType.dyna... | no need for these to be dynamic (string is enough) | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
interface StatusDel extends StatusType {
hidden?: boolean;
id?: string;
}
interface StatusListProps extends TaipyBaseProps, TaipyHoverProps {
value: Array<[string, string] | StatusType> | [string, string] | StatusType;
defaultValue?: string;
withoutClose?: boolean;
withIcons?: boolean;
cu... | How could this throw an exception except if this is not a string ?
Better test the type and ignore if it is not a string |
interface StatusDel extends StatusType {
hidden?: boolean;
id?: string;
}
interface StatusListProps extends TaipyBaseProps, TaipyHoverProps {
value: Array<[string, string] | StatusType> | [string, string] | StatusType;
defaultValue?: string;
withoutClose?: boolean;
withIcons?: boolean;
cu... | @@ -95,6 +97,16 @@ const StatusList = (props: StatusListProps) => {
const [opened, setOpened] = useState(false);
const [multiple, setMultiple] = useState(false);
const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);
+ const content = useMemo(() => {
+ if (props.customIcon) {
+ ... | frontend/taipy-gui/src/components/Taipy/StatusList.tsx | 26 | TypeScript | 0.571 | question | 121 | 51 | 51 | false | feat: Status controls could have a way to have icons instead of the default letters | 2,177 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | Vaibhav91one | Review this pull request change.
Language: TypeScript
File: frontend/taipy-gui/src/components/Taipy/StatusList.tsx
PR Title: feat: Status controls could have a way to have icons instead of the default letters
BEFORE CODE:
interface StatusDel extends StatusType {
hidden?: boolean;
id?: string;
}
interface ... | How could this throw an exception except if this is not a string ?
Better test the type and ignore if it is not a string | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
# Initialize the set of visual elements for this extension library
self.elements = {
# A static element that displays its properties in a fraction
"fraction": Element(
"numerator",
{
"numerator": ElementProperty(PropertyType.num... | can comment this to show that it is the generated name from the python name | # Initialize the set of visual elements for this extension library
self.elements = {
# A static element that displays its properties in a fraction
"fraction": Element(
"numerator",
{
"numerator": ElementProperty(PropertyType.num... | @@ -33,6 +33,14 @@ def __init__(self) -> None:
# element, exported as ExampleLabel in front-end/src/index.ts
react_component="ExampleLabel",
),
+ "basic_table": Element(
+ "data",
+ {
+ "data": ElementProperty(Pro... | doc/gui/extension/example_library/example_library.py | 26 | Python | 0.214 | suggestion | 75 | 51 | 51 | false | Example for tabular data | 2,184 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | namnguyen20999 | Review this pull request change.
Language: Python
File: doc/gui/extension/example_library/example_library.py
PR Title: Example for tabular data
BEFORE CODE: # Initialize the set of visual elements for this extension library
self.elements = {
# A static element that displays its propertie... | can comment this to show that it is the generated name from the python name | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
# Initialize the set of visual elements for this extension library
self.elements = {
# A static element that displays its properties in a fraction
"fraction": Element(
"numerator",
{
"numerator": ElementProperty(PropertyType.num... | ```suggestion
# element, exported as GameTable in front-end/src/index.ts
``` | # Initialize the set of visual elements for this extension library
self.elements = {
# A static element that displays its properties in a fraction
"fraction": Element(
"numerator",
{
"numerator": ElementProperty(PropertyType.num... | @@ -33,13 +33,14 @@ def __init__(self) -> None:
# element, exported as ExampleLabel in front-end/src/index.ts
react_component="ExampleLabel",
),
- "basic_table": Element(
+ "game_table": Element(
"data",
{
... | doc/gui/extension/example_library/example_library.py | 26 | Python | 0.571 | suggestion | 94 | 51 | 51 | false | Example for tabular data | 2,184 | Avaiga/taipy | 12,680 | Python | FabienLelaquais | namnguyen20999 | Review this pull request change.
Language: Python
File: doc/gui/extension/example_library/example_library.py
PR Title: Example for tabular data
BEFORE CODE: # Initialize the set of visual elements for this extension library
self.elements = {
# A static element that displays its propertie... | ```suggestion
# element, exported as GameTable in front-end/src/index.ts
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import pandas as pd
from example_library import ExampleLibrary
from taipy.gui import Gui
chessboard = [
["♖", "♘", "♗", "♕", "♔", "♗", "♘", "♖"],
["♙", "♙", "♙", "♙", "♙", "♙", "♙", "♙"],
["", "", "", "", "", "", "", ""],
["", "", "", "", "", "", "", ""],
["", "", "", "", "", "", "", ""],
["",... | ```suggestion
Gui(page, libraries=[ExampleLibrary()]).run(title="Chess Game")
``` | # Copyright 2021-2024 Avaiga Private Limited
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | @@ -0,0 +1,37 @@
+# Copyright 2021-2024 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required b... | doc/gui/extension/table_chess_game.py | 26 | Python | 0.571 | suggestion | 87 | 27 | 33 | false | Example for tabular data | 2,184 | Avaiga/taipy | 12,680 | Python | FabienLelaquais | namnguyen20999 | Review this pull request change.
Language: Python
File: doc/gui/extension/table_chess_game.py
PR Title: Example for tabular data
BEFORE CODE: import pandas as pd
from example_library import ExampleLibrary
from taipy.gui import Gui
chessboard = [
["♖", "♘", "♗", "♕", "♔", "♗", "♘", "♖"],
["♙", "♙", "♙", "♙... | ```suggestion
Gui(page, libraries=[ExampleLibrary()]).run(title="Chess Game")
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
self.elements = {
# A static element that displays its properties in a fraction
"fraction": Element(
"numerator",
{
"numerator": ElementProperty(PropertyType.number),
"denominator": ElementProperty(PropertyType.numbe... | This line can be commented too | self.elements = {
# A static element that displays its properties in a fraction
"fraction": Element(
"numerator",
{
"numerator": ElementProperty(PropertyType.number),
"denominator": ElementProperty(PropertyType.numbe... | @@ -33,6 +33,15 @@ def __init__(self) -> None:
# element, exported as ExampleLabel in front-end/src/index.ts
react_component="ExampleLabel",
),
+ "game_table": Element(
+ "data",
+ {
+ "data": ElementProperty(Prop... | doc/gui/extension/example_library/example_library.py | 26 | Python | 0.071 | suggestion | 31 | 51 | 51 | false | Example for tabular data | 2,184 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | namnguyen20999 | Review this pull request change.
Language: Python
File: doc/gui/extension/example_library/example_library.py
PR Title: Example for tabular data
BEFORE CODE: self.elements = {
# A static element that displays its properties in a fraction
"fraction": Element(
"numerator... | This line can be commented too | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
// This file is the entry point of the JavaScript bundle loaded by the
// element library.
//
// All the React components that are used by elements should be imported,
// indicating their source file name, then exported.
//
// Note that we export the 'ColoredLabel' component as 'ExampleLabel', which is
// the name used... | ```suggestion
import GameTable from "./GameTable";
``` | // This file is the entry point of the JavaScript bundle loaded by the
// element library.
//
// All the React components that are used by elements should be imported,
// indicating their source file name, then exported.
//
// Note that we export the 'ColoredLabel' component as 'ExampleLabel', which is
// the name used... | @@ -7,5 +7,6 @@
// Note that we export the 'ColoredLabel' component as 'ExampleLabel', which is
// the name used in the element declaration in the element library.
import ColoredLabel from "./ColoredLabel";
+import GameTable from "./BasicTable"; | doc/gui/extension/example_library/front-end/src/index.ts | 10 | TypeScript | 0.571 | suggestion | 56 | 13 | 13 | false | Example for tabular data | 2,184 | Avaiga/taipy | 12,680 | Python | FabienLelaquais | namnguyen20999 | Review this pull request change.
Language: TypeScript
File: doc/gui/extension/example_library/front-end/src/index.ts
PR Title: Example for tabular data
BEFORE CODE: // This file is the entry point of the JavaScript bundle loaded by the
// element library.
//
// All the React components that are used by elements sho... | ```suggestion
import GameTable from "./GameTable";
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
# Copyright 2021-2024 Avaiga Private Limited
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | Please split the <|file_selector|> and <|image|> fragments in two lines to make them more obvious to see.
Also, the callback function should be declared before the page definition, for homogeneity. | # Copyright 2021-2024 Avaiga Private Limited
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | @@ -0,0 +1,36 @@
+# Copyright 2021-2024 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required b... | doc/gui/examples/controls/file_selector_image.py | 25 | Python | 0.429 | suggestion | 198 | 37 | 38 | false | file_selector example | 2,194 | Avaiga/taipy | 12,680 | Python | FabienLelaquais | FredLL-Avaiga | Review this pull request change.
Language: Python
File: doc/gui/examples/controls/file_selector_image.py
PR Title: file_selector example
BEFORE CODE: # Copyright 2021-2024 Avaiga Private Limited
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
#... | Please split the <|file_selector|> and <|image|> fragments in two lines to make them more obvious to see.
Also, the callback function should be declared before the page definition, for homogeneity. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
# Copyright 2021-2024 Avaiga Private Limited
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | If you really want to stress a specific Page Builder API feature, please let me know what that is.
Otherwise, Markdown would be the default code example implementation. | # Copyright 2021-2024 Avaiga Private Limited
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | doc/gui/examples/controls/file_selector_simple.py | 1 | Python | 0.357 | suggestion | 169 | 26 | 26 | false | file_selector example | 2,194 | Avaiga/taipy | 12,680 | Python | FabienLelaquais | FredLL-Avaiga | Review this pull request change.
Language: Python
File: doc/gui/examples/controls/file_selector_simple.py
PR Title: file_selector example
BEFORE CODE: # Copyright 2021-2024 Avaiga Private Limited
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
... | If you really want to stress a specific Page Builder API feature, please let me know what that is.
Otherwise, Markdown would be the default code example implementation. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
base_json.update(
{
"flask_version": str(metadata.version("flask") or ""),
"backend_version": self.__get_version(),
"host": f'{self._get_config("host", "localhost")}:{self._get_config("port", "default")}',
"pytho... | can you write some python test to ensure that __upload_files works the same before and after your changes ? | base_json.update(
{
"flask_version": str(metadata.version("flask") or ""),
"backend_version": self.__get_version(),
"host": f'{self._get_config("host", "localhost")}:{self._get_config("port", "default")}',
"pytho... | @@ -989,6 +989,8 @@ def __upload_files(self):
context = request.form.get("context", None)
upload_data = request.form.get("upload_data", None)
multiple = "multiple" in request.form and request.form["multiple"] == "True"
+ | taipy/gui/gui.py | 26 | Python | 0.429 | question | 107 | 51 | 51 | false | New feature implementation/#2189 Add support for uploading nested folders | 2,206 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | JosuaCarl | Review this pull request change.
Language: Python
File: taipy/gui/gui.py
PR Title: New feature implementation/#2189 Add support for uploading nested folders
BEFORE CODE: base_json.update(
{
"flask_version": str(metadata.version("flask") or ""),
"ba... | can you write some python test to ensure that __upload_files works the same before and after your changes ? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
uploadData?: string;
}
const handleDragOver = (evt: DragEvent) => {
evt.stopPropagation();
evt.preventDefault();
evt.dataTransfer && (evt.dataTransfer.dropEffect = "copy");
};
const defaultSx = { minWidth: "0px" };
const FileSelector = (props: FileSelectorProps) => {
const {
id,
o... | I would check for selectionType?.toLowerCase().startsWith("d") || selectionType?.toLowerCase()).startsWith("folder") | uploadData?: string;
}
const handleDragOver = (evt: DragEvent) => {
evt.stopPropagation();
evt.preventDefault();
evt.dataTransfer && (evt.dataTransfer.dropEffect = "copy");
};
const defaultSx = { minWidth: "0px" };
const FileSelector = (props: FileSelectorProps) => {
const {
id,
o... | @@ -68,14 +68,14 @@ const FileSelector = (props: FileSelectorProps) => {
defaultLabel = "",
updateVarName = "",
multiple = false,
- selectFolder = false,
+ selectionType = "file",
extensions = ".csv,.xlsx",
dropMessage = "Drop here to Upload",
label,
... | frontend/taipy-gui/src/components/Taipy/FileSelector.tsx | 26 | TypeScript | 0.5 | suggestion | 116 | 51 | 51 | false | New feature implementation/#2189 Add support for uploading nested folders | 2,206 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | JosuaCarl | Review this pull request change.
Language: TypeScript
File: frontend/taipy-gui/src/components/Taipy/FileSelector.tsx
PR Title: New feature implementation/#2189 Add support for uploading nested folders
BEFORE CODE: uploadData?: string;
}
const handleDragOver = (evt: DragEvent) => {
evt.stopPropagation();
... | I would check for selectionType?.toLowerCase().startsWith("d") || selectionType?.toLowerCase()).startsWith("folder") | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
.set_attributes(
[
("on_action", PropertyType.function),
("active", PropertyType.dynamic_boolean, True),
("render", PropertyType.dynamic_boolean, True),
("auto", PropertyType.boolean, False),
("bypass_preview", PropertyT... | don't set default value here
In this case, it will add the property which is not necessary | .set_attributes(
[
("on_action", PropertyType.function),
("active", PropertyType.dynamic_boolean, True),
("render", PropertyType.dynamic_boolean, True),
("auto", PropertyType.boolean, False),
("bypass_preview", PropertyT... | @@ -262,7 +262,7 @@ class _Factory:
("on_action", PropertyType.function),
("active", PropertyType.dynamic_boolean, True),
("multiple", PropertyType.boolean, False),
- ("select_folder", PropertyType.boolean, False),
+ ("selection_type", Pro... | taipy/gui/_renderers/factory.py | 26 | Python | 0.214 | suggestion | 91 | 51 | 51 | false | New feature implementation/#2189 Add support for uploading nested folders | 2,206 | Avaiga/taipy | 12,680 | Python | FredLL-Avaiga | JosuaCarl | Review this pull request change.
Language: Python
File: taipy/gui/_renderers/factory.py
PR Title: New feature implementation/#2189 Add support for uploading nested folders
BEFORE CODE: .set_attributes(
[
("on_action", PropertyType.function),
("active", PropertyTyp... | don't set default value here
In this case, it will add the property which is not necessary | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
from taipy.gui import Gui, Icon, State, get_state_id, invoke_callback, invoke_long_callback
# The Wikipedia API used to generate content for a date
wiki_url = "https://en.wikipedia.org/api/rest_v1/feed/onthisday/{type}/{month}/{day}"
event_types = {
"happen": "events",
"passé": "events",
"born": "births",
... | What do you mean?
What does making it a state variable change that? |
# The Wikipedia API used to generate content for a date
wiki_url = "https://en.wikipedia.org/api/rest_v1/feed/onthisday/{type}/{month}/{day}"
event_types = {
"happen": "events",
"passé": "events",
"born": "births",
"né": "births",
"dead": "deaths",
"mort": "deaths",
}
user_agent = "https://taip... | @@ -0,0 +1,181 @@
+# Copyright 2021-2024 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required ... | doc/gui/examples/controls/chat-streaming.py | 26 | Python | 0.286 | question | 68 | 51 | 51 | false | chat streaming example | 2,213 | Avaiga/taipy | 12,680 | Python | FabienLelaquais | FredLL-Avaiga | Review this pull request change.
Language: Python
File: doc/gui/examples/controls/chat-streaming.py
PR Title: chat streaming example
BEFORE CODE: from taipy.gui import Gui, Icon, State, get_state_id, invoke_callback, invoke_long_callback
# The Wikipedia API used to generate content for a date
wiki_url = "https://e... | What do you mean?
What does making it a state variable change that? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
break
type_event = type_event if type_event else "events"
month = None
day = None
for m in re.finditer(r"(\d\d?)", request):
if month is None:
month = m.group()
elif day is None:
day = m.group()
break
if month is None:
month = ... | Extract from the if construct. |
# Display the request
state.messages.append((f"{len(state.messages)}", args[2], args[3]))
state.refresh("messages")
# Analyse the request
request = args[2].lower()
type_event = None
for word in event_types:
if word in request:
type_event = event_types[word]
... | @@ -0,0 +1,181 @@
+# Copyright 2021-2024 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required ... | doc/gui/examples/controls/chat-streaming.py | 26 | Python | 0.143 | refactor | 30 | 31 | 42 | false | chat streaming example | 2,213 | Avaiga/taipy | 12,680 | Python | FabienLelaquais | FredLL-Avaiga | Review this pull request change.
Language: Python
File: doc/gui/examples/controls/chat-streaming.py
PR Title: chat streaming example
BEFORE CODE: break
type_event = type_event if type_event else "events"
month = None
day = None
for m in re.finditer(r"(\d\d?)", request):
if month... | Extract from the if construct. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
# Copyright 2021-2024 Avaiga Private Limited
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | It would be nice to have at least a comment for each function, indicating vaguely what it does and who invokes it. | # Copyright 2021-2024 Avaiga Private Limited
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | doc/gui/examples/controls/chat-streaming.py | 1 | Python | 0.357 | suggestion | 114 | 26 | 26 | false | chat streaming example | 2,213 | Avaiga/taipy | 12,680 | Python | FabienLelaquais | FredLL-Avaiga | Review this pull request change.
Language: Python
File: doc/gui/examples/controls/chat-streaming.py
PR Title: chat streaming example
BEFORE CODE: # Copyright 2021-2024 Avaiga Private Limited
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the... | It would be nice to have at least a comment for each function, indicating vaguely what it does and who invokes it. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
state_id,
set_message,
["requesting Wikipedia ..."],
)
request = wiki_url.format(type=event_type, month=month, day=day)
req = requests.get(request, headers={"accept": "application/json; charset=utf-8;", "User-Agent": user_agent})
# handle the response
if req.status_code == 20... | ```suggestion
# Invoked by the 'on_action' callback of the chat control when the user presses the Send button
``` | state_id,
set_message,
["Fetching information from Wikipedia ..."],
)
request = wiki_url.format(type=event_type, month=month, day=day)
req = requests.get(request, headers={"accept": "application/json; charset=utf-8;", "User-Agent": user_agent})
# Handle the response
if req.st... | @@ -0,0 +1,192 @@
+# Copyright 2021-2024 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required ... | doc/gui/examples/controls/chat-streaming.py | 26 | Python | 0.786 | suggestion | 115 | 51 | 51 | false | chat streaming example | 2,213 | Avaiga/taipy | 12,680 | Python | FabienLelaquais | FredLL-Avaiga | Review this pull request change.
Language: Python
File: doc/gui/examples/controls/chat-streaming.py
PR Title: chat streaming example
BEFORE CODE: state_id,
set_message,
["requesting Wikipedia ..."],
)
request = wiki_url.format(type=event_type, month=month, day=day)
req = requests... | ```suggestion
# Invoked by the 'on_action' callback of the chat control when the user presses the Send button
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
# To execute this script, make sure that the taipy-gui package is installed in your
# Python environment and run:
# python <script>
# -----------------------------------------------------------------------------------------
import datetime
import re
import time
import typing as t
import requests # type: ignore[im... | ```suggestion
# The list of messages
``` | # To execute this script, make sure that the taipy-gui package is installed in your
# Python environment and run:
# python <script>
# -----------------------------------------------------------------------------------------
import datetime
import re
import time
import typing as t
import requests # type: ignore[im... | @@ -0,0 +1,192 @@
+# Copyright 2021-2024 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required ... | doc/gui/examples/controls/chat-streaming.py | 26 | Python | 0.429 | suggestion | 42 | 51 | 51 | false | chat streaming example | 2,213 | Avaiga/taipy | 12,680 | Python | FabienLelaquais | FredLL-Avaiga | Review this pull request change.
Language: Python
File: doc/gui/examples/controls/chat-streaming.py
PR Title: chat streaming example
BEFORE CODE: # To execute this script, make sure that the taipy-gui package is installed in your
# Python environment and run:
# python <script>
# --------------------------------... | ```suggestion
# The list of messages
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
# -----------------------------------------------------------------------------------------
import datetime
import re
import time
import typing as t
import requests # type: ignore[import-untyped]
from taipy.gui import Gui, Icon, State, get_state_id, invoke_callback, invoke_long_callback
# The Wikipedia API used to ... | ```suggestion
# The two users of this app
``` | # -----------------------------------------------------------------------------------------
import datetime
import re
import time
import typing as t
import requests # type: ignore[import-untyped]
from taipy.gui import Gui, Icon, State, get_state_id, invoke_callback, invoke_long_callback
# The Wikipedia API used to ... | @@ -0,0 +1,192 @@
+# Copyright 2021-2024 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required ... | doc/gui/examples/controls/chat-streaming.py | 26 | Python | 0.5 | suggestion | 47 | 51 | 51 | false | chat streaming example | 2,213 | Avaiga/taipy | 12,680 | Python | FabienLelaquais | FredLL-Avaiga | Review this pull request change.
Language: Python
File: doc/gui/examples/controls/chat-streaming.py
PR Title: chat streaming example
BEFORE CODE: # -----------------------------------------------------------------------------------------
import datetime
import re
import time
import typing as t
import requests # t... | ```suggestion
# The two users of this app
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
from taipy.gui import Gui, Icon, State, get_state_id, invoke_callback, invoke_long_callback
# The Wikipedia API used to generate content for a date
wiki_url = "https://en.wikipedia.org/api/rest_v1/feed/onthisday/{type}/{month}/{day}"
event_types = {
"happen": "events",
"passé": "events",
"born": "births",... | ```suggestion
# Initialize the user state
``` |
from taipy.gui import Gui, Icon, State, get_state_id, invoke_callback, invoke_long_callback
# The Wikipedia API used to generate content for a date
wiki_url = "https://en.wikipedia.org/api/rest_v1/feed/onthisday/{type}/{month}/{day}"
event_types = {
"happen": "events",
"passé": "events",
"born": "births",... | @@ -0,0 +1,192 @@
+# Copyright 2021-2024 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required ... | doc/gui/examples/controls/chat-streaming.py | 26 | Python | 0.5 | suggestion | 47 | 51 | 51 | false | chat streaming example | 2,213 | Avaiga/taipy | 12,680 | Python | FabienLelaquais | FredLL-Avaiga | Review this pull request change.
Language: Python
File: doc/gui/examples/controls/chat-streaming.py
PR Title: chat streaming example
BEFORE CODE:
from taipy.gui import Gui, Icon, State, get_state_id, invoke_callback, invoke_long_callback
# The Wikipedia API used to generate content for a date
wiki_url = "https://... | ```suggestion
# Initialize the user state
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
# The Wikipedia API used to generate content for a date
wiki_url = "https://en.wikipedia.org/api/rest_v1/feed/onthisday/{type}/{month}/{day}"
event_types = {
"happen": "events",
"passé": "events",
"born": "births",
"né": "births",
"dead": "deaths",
"mort": "deaths",
}
user_agent = "https://taip... | ```suggestion
# Messages are for this user only
``` |
# The Wikipedia API used to generate content for a date
wiki_url = "https://en.wikipedia.org/api/rest_v1/feed/onthisday/{type}/{month}/{day}"
event_types = {
"happen": "events",
"passé": "events",
"born": "births",
"né": "births",
"dead": "deaths",
"mort": "deaths",
}
user_agent = "https://taip... | @@ -0,0 +1,192 @@
+# Copyright 2021-2024 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required ... | doc/gui/examples/controls/chat-streaming.py | 26 | Python | 0.643 | suggestion | 57 | 51 | 51 | false | chat streaming example | 2,213 | Avaiga/taipy | 12,680 | Python | FabienLelaquais | FredLL-Avaiga | Review this pull request change.
Language: Python
File: doc/gui/examples/controls/chat-streaming.py
PR Title: chat streaming example
BEFORE CODE:
# The Wikipedia API used to generate content for a date
wiki_url = "https://en.wikipedia.org/api/rest_v1/feed/onthisday/{type}/{month}/{day}"
event_types = {
"happen... | ```suggestion
# Messages are for this user only
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
"happen": "events",
"passé": "events",
"born": "births",
"né": "births",
"dead": "deaths",
"mort": "deaths",
}
user_agent = "https://taipy.io/demo"
# the list of messages
messages: list[tuple[str, str, str]] = [] # (Message id, message, sender)
# the users
users = [
["wikipedia", Icon("ht... | ```suggestion
# Add the image if there is one in the Wikipedia returned data
``` | "happen": "events",
"passé": "events",
"born": "births",
"né": "births",
"dead": "deaths",
"mort": "deaths",
}
user_agent = "https://taipy.io/demo"
# The list of messages
messages: list[tuple[str, str, str]] = [] # (Message id, message, sender)
# The two users of this app
users = [
["wiki... | @@ -0,0 +1,192 @@
+# Copyright 2021-2024 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required ... | doc/gui/examples/controls/chat-streaming.py | 26 | Python | 0.571 | suggestion | 82 | 51 | 51 | false | chat streaming example | 2,213 | Avaiga/taipy | 12,680 | Python | FabienLelaquais | FredLL-Avaiga | Review this pull request change.
Language: Python
File: doc/gui/examples/controls/chat-streaming.py
PR Title: chat streaming example
BEFORE CODE: "happen": "events",
"passé": "events",
"born": "births",
"né": "births",
"dead": "deaths",
"mort": "deaths",
}
user_agent = "https://taipy.io/demo... | ```suggestion
# Add the image if there is one in the Wikipedia returned data
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
"né": "births",
"dead": "deaths",
"mort": "deaths",
}
user_agent = "https://taipy.io/demo"
# the list of messages
messages: list[tuple[str, str, str]] = [] # (Message id, message, sender)
# the users
users = [
["wikipedia", Icon("https://www.wikipedia.org/static/apple-touch/wikipedia.png", "Wikipedia... | ```suggestion
if (pos := msg_content.find(text)) > -1:
```
may be less readable. Your choice. | "né": "births",
"dead": "deaths",
"mort": "deaths",
}
user_agent = "https://taipy.io/demo"
# The list of messages
messages: list[tuple[str, str, str]] = [] # (Message id, message, sender)
# The two users of this app
users = [
["wikipedia", Icon("https://www.wikipedia.org/static/apple-touch/wikipedia.... | @@ -0,0 +1,192 @@
+# Copyright 2021-2024 Avaiga Private Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required ... | doc/gui/examples/controls/chat-streaming.py | 26 | Python | 0.714 | suggestion | 100 | 51 | 51 | false | chat streaming example | 2,213 | Avaiga/taipy | 12,680 | Python | FabienLelaquais | FredLL-Avaiga | Review this pull request change.
Language: Python
File: doc/gui/examples/controls/chat-streaming.py
PR Title: chat streaming example
BEFORE CODE: "né": "births",
"dead": "deaths",
"mort": "deaths",
}
user_agent = "https://taipy.io/demo"
# the list of messages
messages: list[tuple[str, str, str]] = [] ... | ```suggestion
if (pos := msg_content.find(text)) > -1:
```
may be less readable. Your choice. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.