Repository: apache/airflow
File: providers/google/src/airflow/providers/google/cloud/transfers/calendar_to_gcs.py (Python)

Code before:
        self.time_zone = time_zone
        self.updated_min = updated_min
        self.destination_bucket = destination_bucket
        self.destination_path = destination_path
        self.impersonation_chain = impersonation_chain
        if unwrap_single is None:
            self.unwrap_single = True
            import warnings

            warnings.warn(
                "The default value of unwrap_single will change from True to False in a future release. "
                "Please set unwrap_single explicitly to avoid this warning.",
                FutureWarning,
                stacklevel=2,
            )
        else:
            self.unwrap_single = unwrap_single

        self.return_gcs_uri = return_gcs_uri

        if self.unwrap_single and self.return_gcs_uri:
            raise ValueError(
                "return_gcs_uri cannot be True together with unwrap_single=True. "
                "In the future, all operators will return list of URIs, so please set "
                "unwrap_single=False when using return_gcs_uri=True."
            )

    def _upload_data(
        self,
        events: list[Any],
    ) -> tuple[str, str]:
        gcs_hook = GCSHook(
            gcp_conn_id=self.gcp_conn_id,
            impersonation_chain=self.impersonation_chain,
        )

        # Construct destination file path
        file_name = f"{self.calendar_id}.json".replace(" ", "_")
        dest_file_name = (
            f"{self.destination_path.strip('/')}/{file_name}" if self.destination_path else file_name
        )

        with NamedTemporaryFile("w+") as temp_file:
            # Write data
            json.dump(events, temp_file)
            temp_file.flush()

            # Upload to GCS
            gcs_hook.upload(
                bucket_name=self.destination_bucket,
                object_name=dest_file_name,

Review comment (suggestion):
```suggestion
        if not self.unwrap_single and not self.return_gcs_uri:
            raise ValueError(
                "return_gcs_uri cannot be False together with unwrap_single=False. "
                "In the future, all operators will return list of URIs, so please set "
                "unwrap_single=False when using return_gcs_uri=True."
            )
```

Code after:
        self.time_min = time_min
        self.time_zone = time_zone
        self.updated_min = updated_min
        self.destination_bucket = destination_bucket
        self.destination_path = destination_path
        self.impersonation_chain = impersonation_chain

        import warnings

        if unwrap_single is None:
            self.unwrap_single = True
            warnings.warn(
                "The default value of unwrap_single will change from True to False in a future release. "
                "Please set unwrap_single explicitly to avoid this warning.",
                FutureWarning,
                stacklevel=2,
            )
        else:
            self.unwrap_single = unwrap_single

        if return_gcs_uri is None:
            self.return_gcs_uri = False
            warnings.warn(
                "The return_gcs_uri parameter is deprecated and will be removed in a future release. "
                "In the future, operators will always return full GCS URIs.",
                FutureWarning,
                stacklevel=2,
            )
        else:
            self.return_gcs_uri = return_gcs_uri

        # Validate that the combination is valid: we cannot have both unwrap_single=False
        # and return_gcs_uri=False as this combination is backward-incompatible with the
        # future behavior of always returning lists of URIs.
        # Note: After None handling above, both values are guaranteed to be bool (not None).
        if not self.unwrap_single and not self.return_gcs_uri:
            raise ValueError(
                "return_gcs_uri cannot be False together with unwrap_single=False. "
                "In the future, all operators will return list of URIs, so please set "
                "return_gcs_uri=True when using unwrap_single=False.",
            )

    def _upload_data(
        self,
        events: list[Any],
    ) -> tuple[str, str]:
        gcs_hook = GCSHook(
            gcp_conn_id=self.gcp_conn_id,
            impersonation_chain=self.impersonation_chain,
        )