Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion asyncdb/drivers/cassandra.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ async def connection(self, keyspace=None):
execution_profiles=profiles,
**params,
)
print(self._cluster)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Removed print statement

The print statement for the cluster has been removed. Ensure that this information is logged appropriately if needed for debugging or monitoring.

Suggested change
print(self._cluster)
import logging
logger = logging.getLogger(__name__)
logger.debug(f"Cluster: {self._cluster}")

try:
self._connection = self._cluster.connect(keyspace=keyspace)
except NoHostAvailable as ex:
Expand Down
2 changes: 0 additions & 2 deletions asyncdb/drivers/memcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def create_dsn(self, params: dict):
return params

async def connect(self):
self._logger.debug(f"Memcache: Connecting to {self._params}")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Removed debug logging for Memcache connection

The debug logging for the Memcache connection has been removed. If this was useful for debugging purposes, consider adding a conditional debug flag to enable it when needed.

Suggested change
self._logger.debug(f"Memcache: Connecting to {self._params}")
return params
async def connect(self, debug=False):
if debug:
self._logger.debug(f"Memcache: Connecting to {self._params}")
try:
self._pool = aiomcache.Client(pool_size=self._max_queries, **self._params)

try:
self._pool = aiomcache.Client(pool_size=self._max_queries, **self._params)

Expand Down Expand Up @@ -116,7 +115,6 @@ async def connection(self):
"""
__init async Memcache initialization
"""
self._logger.debug(f"Memcache: Connecting to {self._params}")
try:
self._connection = aiomcache.Client(**self._params)
except aiomcache.exceptions.ValidationException as err:
Expand Down
7 changes: 4 additions & 3 deletions asyncdb/drivers/pg.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ async def connect(self):
"""
Creates a Pool Connection.
"""
self._logger.debug(f"AsyncPg (Pool): Connecting to {self._dsn}")
# self._logger.debug(f"AsyncPg (Pool): Connecting to {self._dsn}")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Commented out debug logging

The debug logging for the connection has been commented out. If this is intentional for production, consider adding a conditional debug flag to enable it when needed.

Suggested change
# self._logger.debug(f"AsyncPg (Pool): Connecting to {self._dsn}")
if self._debug:
self._logger.debug(f"AsyncPg (Pool): Connecting to {self._dsn}")

try:
# TODO: pass a setup class for set_builtin_type_codec and a setup for add listener
server_settings = {
Expand Down Expand Up @@ -635,14 +635,15 @@ def _uuid_decoder(value):
try:
r = await self._connection.execute(config)
except RuntimeError as err:
self._logger.warning(f"Pg: Error on Connection Configuration: {err}")
self._logger.warning(
f"Pg: Error on Connection Configuration: {err}"
)
if self._init_func is not None and callable(self._init_func):
try:
await self._init_func(self._connection) # pylint: disable=E1102
except (ValueError, RuntimeError) as err:
self._logger.warning(f"Error on Init Connection: {err}")
self._initialized_on = time.time()
self._logger.debug(f"Initialized on: {self._initialized_on}")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Removed debug logging for initialization

The debug logging for initialization has been removed. If this was useful for debugging purposes, consider adding a conditional debug flag to enable it when needed.

Suggested change
self._logger.debug(f"Initialized on: {self._initialized_on}")
except (ValueError, RuntimeError) as err:
self._logger.warning(f"Error on Init Connection: {err}")
self._initialized_on = time.time()
if self._debug:
self._logger.debug(f"Initialized on: {self._initialized_on}")
return self
except ConnectionRefusedError as err:

return self
except ConnectionRefusedError as err:
raise UninitializedError(
Expand Down
1 change: 0 additions & 1 deletion asyncdb/drivers/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ async def connect(self, **kwargs):
"""
__init async db initialization
"""
self._logger.debug(f"Redis Pool: Connecting to {self._dsn}")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Removed debug logging for Redis connection

The debug logging for the Redis connection has been removed. If this was useful for debugging purposes, consider adding a conditional debug flag to enable it when needed.

Suggested change
self._logger.debug(f"Redis Pool: Connecting to {self._dsn}")
if self._debug:
self._logger.debug(f"Redis Pool: Connecting to {self._dsn}")

try:
self._pool = aioredis.ConnectionPool.from_url(
self._dsn,
Expand Down
3 changes: 0 additions & 3 deletions asyncdb/drivers/rethink.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ def __init__(
self.params["db"] = self.params.get("database", None)

async def connection(self):
self._logger.debug(
f'RT Connection to host {self.params["host"]}:{self.params["port"]}'
)
Comment on lines -116 to -118
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Removed debug logging for RethinkDB connection

The debug logging for the RethinkDB connection has been removed. If this was useful for monitoring connections, consider adding a conditional debug flag to enable it when needed.

Suggested change
self._logger.debug(
f'RT Connection to host {self.params["host"]}:{self.params["port"]}'
)
if self.params.get("debug", False):
self._logger.debug(
f'RT Connection to host {self.params["host"]}:{self.params["port"]}'
)

self._connection = None
self.params["timeout"] = self._timeout
try:
Expand Down
2 changes: 1 addition & 1 deletion asyncdb/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
__title__ = "asyncdb"
__description__ = "Library for Asynchronous data source connections \
Collection of asyncio drivers."
__version__ = "2.7.10"
__version__ = "2.7.11"
__author__ = "Jesus Lara"
__author_email__ = "jesuslarag@gmail.com"
__license__ = "BSD"
3 changes: 1 addition & 2 deletions examples/test_influx.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ async def test_data(driver, params, event_loop):
"user": "troc_pgdata",
"password": "12345678",
"org": "navigator",
"bucket": "navigator",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 issue (security): Removed sensitive token

The token has been removed from the parameters. Ensure that this change does not affect the functionality of the test and that the token is securely managed elsewhere.

"token": "qroJLmcrjM-IsDhxz-nR_NIoUxpjAgDz9AuXJJlTnikCIr70CNa_IxXlO5BID4LVrpHHCjzzeSr_UZab5ON_9A=="
"bucket": "navigator"
}
loop.run_until_complete(
test_connection(DRIVER, params=p, event_loop=loop)
Expand Down