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

[FSTORE-1540] Set autocommit read for mysql connection of feature views #1390

Merged
merged 1 commit into from
Oct 23, 2024
Merged
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
35 changes: 17 additions & 18 deletions python/hsfs/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,26 @@
#
from __future__ import annotations

import re
import asyncio
import itertools
import json
from typing import Union
import pandas as pd
import numpy as np
import time
import re
import threading
import itertools

from datetime import datetime, date, timezone
import time
from datetime import date, datetime, timezone
from typing import Union
from urllib.parse import urljoin, urlparse

import numpy as np
import pandas as pd
from aiomysql.sa import create_engine as async_create_engine
from sqlalchemy import create_engine
from sqlalchemy.engine.url import make_url

from hsfs import client, feature
from hsfs import feature_group as fg_mod
from hsfs.client import exceptions
from hsfs.core import variable_api
from aiomysql.sa import create_engine as async_create_engine
import asyncio
from sqlalchemy.engine.url import make_url

FEATURE_STORE_NAME_SUFFIX = "_featurestore"

Expand Down Expand Up @@ -167,20 +166,20 @@ async def create_async_engine(
else:
hostname = url.host

if options is None:
options = {}

pool = await async_create_engine(
host=hostname,
port=3306,
user=online_options["user"],
password=online_options["password"],
db=url.database,
loop=asyncio.get_running_loop(),
minsize=(
options.get("minsize", default_min_size) if options else default_min_size
),
maxsize=(
options.get("maxsize", default_min_size) if options else default_min_size
),
pool_recycle=(options.get("pool_recycle", -1) if options else -1),
minsize=options.get("minsize", default_min_size),
maxsize=options.get("maxsize", default_min_size),
pool_recycle=options.get("pool_recycle", -1),
autocommit=options.get("autocommit", True),
)
return pool

Expand Down
Loading