Пример #1
0
    def get_job_client(self, location: Optional[str] = None) -> JobControllerClient:
        """Returns JobControllerClient."""
        client_options = {'api_endpoint': f'{location}-dataproc.googleapis.com:443'} if location else None

        return JobControllerClient(
            credentials=self._get_credentials(), client_info=self.client_info, client_options=client_options
        )
Пример #2
0
    def get_job_client(self,
                       region: Optional[str] = None,
                       location: Optional[str] = None) -> JobControllerClient:
        """Returns JobControllerClient."""
        if location is not None:
            warnings.warn(
                "Parameter `location` will be deprecated. "
                "Please provide value through `region` parameter instead.",
                DeprecationWarning,
                stacklevel=2,
            )
            region = location
        client_options = None
        if region and region != 'global':
            client_options = {
                'api_endpoint': f'{region}-dataproc.googleapis.com:443'
            }

        return JobControllerClient(credentials=self._get_credentials(),
                                   client_info=self.client_info,
                                   client_options=client_options)