How to use the pyathena.util.synchronized function in PyAthena

To help you get started, we’ve selected a few PyAthena examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github laughingman7743 / PyAthena / pyathena / cursor.py View on Github external
    @synchronized
    def fetchone(self):
        if not self.has_result_set:
            raise ProgrammingError('No result set.')
        return self._result_set.fetchone()
github laughingman7743 / PyAthena / pyathena / cursor.py View on Github external
    @synchronized
    def fetchall(self):
        if not self.has_result_set:
            raise ProgrammingError('No result set.')
        return self._result_set.fetchall()
github laughingman7743 / PyAthena / pyathena / cursor.py View on Github external
    @synchronized
    def cancel(self):
        if not self._query_id:
            raise ProgrammingError('QueryExecutionId is none or empty.')
        self._cancel(self._query_id)
github laughingman7743 / PyAthena / pyathena / pandas_cursor.py View on Github external
    @synchronized
    def fetchall(self):
        if not self.has_result_set:
            raise ProgrammingError('No result set.')
        return self._result_set.fetchall()
github laughingman7743 / PyAthena / pyathena / pandas_cursor.py View on Github external
    @synchronized
    def fetchone(self):
        if not self.has_result_set:
            raise ProgrammingError('No result set.')
        return self._result_set.fetchone()
github laughingman7743 / PyAthena / pyathena / cursor.py View on Github external
    @synchronized
    def fetchmany(self, size=None):
        if not self.has_result_set:
            raise ProgrammingError('No result set.')
        return self._result_set.fetchmany(size)
github laughingman7743 / PyAthena / pyathena / pandas_cursor.py View on Github external
    @synchronized
    def as_pandas(self):
        if not self.has_result_set:
            raise ProgrammingError('No result set.')
        return self._result_set.as_pandas()
github laughingman7743 / PyAthena / pyathena / pandas_cursor.py View on Github external
    @synchronized
    def fetchmany(self, size=None):
        if not self.has_result_set:
            raise ProgrammingError('No result set.')
        return self._result_set.fetchmany(size)
github laughingman7743 / PyAthena / pyathena / pandas_cursor.py View on Github external
    @synchronized
    def execute(self, operation, parameters=None, work_group=None, s3_staging_dir=None,
                cache_size=0):
        self._reset_state()
        self._query_id = self._execute(operation,
                                       parameters=parameters,
                                       work_group=work_group,
                                       s3_staging_dir=s3_staging_dir,
                                       cache_size=cache_size)
        query_execution = self._poll(self._query_id)
        if query_execution.state == AthenaQueryExecution.STATE_SUCCEEDED:
            self._result_set = AthenaPandasResultSet(
                self._connection, self._converter, query_execution, self.arraysize,
                self._retry_config)
        else:
            raise OperationalError(query_execution.state_change_reason)
        return self
github laughingman7743 / PyAthena / pyathena / cursor.py View on Github external
    @synchronized
    def execute(self, operation, parameters=None, work_group=None, s3_staging_dir=None,
                cache_size=0):
        self._reset_state()
        self._query_id = self._execute(operation,
                                       parameters=parameters,
                                       work_group=work_group,
                                       s3_staging_dir=s3_staging_dir,
                                       cache_size=cache_size)
        query_execution = self._poll(self._query_id)
        if query_execution.state == AthenaQueryExecution.STATE_SUCCEEDED:
            self._result_set = AthenaResultSet(
                self._connection, self._converter, query_execution, self.arraysize,
                self._retry_config)
        else:
            raise OperationalError(query_execution.state_change_reason)
        return self