Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update PG ver #18

Merged
merged 1 commit into from
May 26, 2024
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
4 changes: 2 additions & 2 deletions src/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Aloha!

[![License](https://img.shields.io/github/license/QPod/aloha)](https://github.com/QPod/aloha/blob/main/LICENSE)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/QPod/aloha/build)](https://github.com/QPod/aloha/actions)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/QPod/aloha-python/pip.yml?branch=main)](https://github.com/QPod/aloha-python/actions)
[![Join the Gitter Chat](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/QPod/)
[![PyPI version](https://img.shields.io/pypi/v/aloha)](https://pypi.python.org/pypi/aloha/)
[![PyPI Downloads](https://img.shields.io/pypi/dm/aloha)](https://pepy.tech/badge/aloha/)
Expand All @@ -21,6 +21,6 @@ Please generously STAR★ our project or donate to us! [![GitHub Starts](https:

## Getting started

```py
```shell
pip install aloha[all]
```
8 changes: 4 additions & 4 deletions src/aloha/db/postgres.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
__all__ = ('PostgresOperator',)

import psycopg2
import psycopg
from sqlalchemy import create_engine
from sqlalchemy.sql import text

from .base import PasswordVault
from ..logger import LOG

LOG.debug('postgres: psycopg2 version = %s' % psycopg2.__version__)
LOG.debug('postgres: psycopg2 version = %s' % psycopg.__version__)


class PostgresOperator:
Expand All @@ -26,8 +26,8 @@ def __init__(self, db_config, **kwargs):

try:
self.engine = create_engine(
'postgresql+psycopg2://{user}:{password}@{host}:{port}/{dbname}'.format(**self._config),
connect_args=connect_args, client_encoding='utf8', encoding='utf-8',
'postgresql+psycopg://{user}:{password}@{host}:{port}/{dbname}'.format(**self._config),
connect_args=connect_args, client_encoding='utf8',
pool_size=20, max_overflow=10, pool_pre_ping=True, **kwargs
)
LOG.debug("PostgresSQL connected: {host}:{port}/{dbname}".format(**self._config))
Expand Down
2 changes: 1 addition & 1 deletion src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
dict_extra_requires = {
'build': ['Cython'],
'service': ['requests', 'tornado', 'psutil', 'pyjwt'],
'db': ['sqlalchemy<2', 'psycopg2-binary', 'pymysql', 'elasticsearch', 'pymongo', 'redis>4.2.0'],
'db': ['sqlalchemy', 'psycopg[binary]', 'pymysql', 'elasticsearch', 'pymongo', 'redis'],
'stream': ['confluent_kafka'],
'data': ['pandas'],
'report': ['openpyxl>=3', 'XlsxWriter'],
Expand Down