Repository: Avaiga/taipy
File: taipy/core/data/aws_s3.py (Python)

Code before:
    def __init__(
        self,
        config_id: str,
        scope: Scope,
        **properties: Any,
    ) -> None:
        _check_dependency_is_installed("S3 Data Node", "boto3")
        if properties is None:
            properties = {}
        required = self._REQUIRED_PROPERTIES
        if missing := set(required) - set(properties.keys()):
            raise MissingRequiredProperty(
                f"The following properties {', '.join(missing)} were not informed and are required."
            )
        super().__init__(
            config_id,
            scope,
            **properties,
        )

        self._s3_client = boto3.client(
            "s3",
            aws_access_key_id=properties.get(self.__AWS_ACCESS_KEY_ID),
            aws_secret_access_key=properties.get(self.__AWS_SECRET_ACCESS_KEY),
            region_name=properties.get(self.__AWS_REGION), 
            **properties.get(self.__AWS_S3_OBJECT_PARAMETERS, {}),
        )

        if not self._last_edit_date:  # type: ignore
            self._last_edit_date = datetime.now()

        self._TAIPY_PROPERTIES.update(
            {
                self.__AWS_ACCESS_KEY_ID,
                self.__AWS_SECRET_ACCESS_KEY,
                self.__AWS_STORAGE_BUCKET_NAME,
                self.__AWS_S3_OBJECT_KEY,
                self.__AWS_REGION,
                self.__AWS_S3_OBJECT_PARAMETERS,
            }
        )

    @classmethod
    def storage_type(cls) -> str:
        return cls.__STORAGE_TYPE

    def _read(self):
        properties = self.properties
        aws_s3_object = self._s3_client.get_object(
            Bucket=properties[self.__AWS_STORAGE_BUCKET_NAME],
            Key=properties[self.__AWS_S3_OBJECT_KEY],

Review comment (suggestion):
The arguments for [`boto3.client()`](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html#boto3.session.Session.client) and [`S3.Client.get_object()`](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3/client/get_object.html) and [`S3.Client.put_object()`](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3/client/put_object.html) are all different.

Here, using the same parameters for all methods will not work.

We can:
- have a different set of parameters for each method, like `__AWS_S3_CLIENT_PARAMETERS`, `__AWS_S3_GET_OBJECT_PARAMETERS`, and `__AWS_S3_PUT_OBJECT_PARAMETERS`
- take a look into the list of parameters for each method, decide which parameters are the most important, and only expose those.

I would suggest the former approach, since it's the most generic.

Code after:
        id: Optional[DataNodeId] = None,
        owner_id: Optional[str] = None,
        parent_ids: Optional[Set[str]] = None,
        last_edit_date: Optional[datetime] = None,
        edits: Optional[List[Edit]] = None,
        version: str = None,
        validity_period: Optional[timedelta] = None,
        edit_in_progress: bool = False,
        editor_id: Optional[str] = None,
        editor_expiration_date: Optional[datetime] = None,
        properties: Optional[Dict] = None,
    ) -> None:
        _check_dependency_is_installed("S3 Data Node", "boto3")
        if properties is None:
            properties = {}
        required = self._REQUIRED_PROPERTIES
        if missing := set(required) - set(properties.keys()):
            raise MissingRequiredProperty(
                f"The following properties {', '.join(missing)} were not informed and are required."
            )
        super().__init__(
            config_id,
            scope,
            id,
            owner_id,
            parent_ids,
            last_edit_date,
            edits,
            version or _VersionManagerFactory._build_manager()._get_latest_version(),
            validity_period,
            edit_in_progress,
            editor_id,
            editor_expiration_date,
            **properties,
        )

        self._s3_client = boto3.client(
            "s3",
            aws_access_key_id=properties.get(self.__AWS_ACCESS_KEY_ID),
            aws_secret_access_key=properties.get(self.__AWS_SECRET_ACCESS_KEY),
            region_name=properties.get(self.__AWS_REGION),
            **properties.get(self.__AWS_S3_CLIENT_PARAMETERS, {}),
        )

        if not self._last_edit_date:  # type: ignore
            self._last_edit_date = datetime.now()

        self._TAIPY_PROPERTIES.update(
            {
                self.__AWS_ACCESS_KEY_ID,
                self.__AWS_SECRET_ACCESS_KEY,