Repository: feast-dev/feast

Issue:
Dev Environment Breaks with MySQL 8.3 During Installation
## Description
When setting up the development environment with MySQL version 8.3, `pip install -e ".[dev]"`  fails. 

## Expected Behavior 
Running `pip install -e ".[dev]"` should successfully install all necessary development dependencies without errors, even with MySQL 8.3.

## Current Behavior
The installation process breaks when attempting `pip install -e ".[dev]"`. The following errors are encountered:
```
src/MySQLdb/_mysql.c:527:9: error: call to undeclared function 'mysql_ssl_set'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
              mysql_ssl_set(&(self->connection), key, cert, ca, capath, cipher);
              ^
      src/MySQLdb/_mysql.c:527:9: note: did you mean 'mysql_close'?
      /usr/local/Cellar/mysql/8.3.0/include/mysql/mysql.h:797:14: note: 'mysql_close' declared here
      void STDCALL mysql_close(MYSQL *sock);
                   ^
      src/MySQLdb/_mysql.c:1795:9: error: call to undeclared function 'mysql_kill'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
          r = mysql_kill(&(self->connection), pid);
              ^
      src/MySQLdb/_mysql.c:1795:9: note: did you mean 'mysql_ping'?
      /usr/local/Cellar/mysql/8.3.0/include/mysql/mysql.h:525:13: note: 'mysql_ping' declared here
      int STDCALL mysql_ping(MYSQL *mysql);
                  ^
      src/MySQLdb/_mysql.c:2011:9: error: call to undeclared function 'mysql_shutdown'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
          r = mysql_shutdown(&(self->connection), SHUTDOWN_DEFAULT);
              ^
      3 errors generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for mysqlclient
Successfully built feast
Failed to build mysqlclient
ERROR: Could not build wheels for mysqlclient, which is required to install pyproject.toml-based projects
```

## Steps to reproduce
1. Create and activate a new Conda environment for `feast`:
 ```
 conda create --name feast python=3.9
 conda activate feast
 ```
 2. Install dependencies:
   ```
   pip install pip-tools
   brew install mysql@8.3
   brew install xz protobuf openssl zlib
   pip install cryptography -U
   conda install protobuf
   conda install pymssql
   pip install -e ".[dev]"
   ```  
 


Discussion:
Note: **MySQL 8.3**  release last month(14 Dec 2023) . @tsisodia10 you tried with older version <8.3  which is working fine right ? 
> Note: **MySQL 8.3** release last month(14 Dec 2023) . @tsisodia10 you tried with older version <8.3 which is working fine right ?

@redhatHameed That's right, I tried with the older version(8.0 to be precise). 
same for me. 8.3 just falls apart
I looked at how `mysqlclient` is used in the project and found that we are actually barely using it at all. mysql online store implementation uses `pymysql`, the only place `mysqlclient` is used right now is a single test for sql registry and even that's done through sqlalchemy, therefore it will be pretty straightforward to change that test to use `pymysql` as well. I'll open a PR to remove `mysqlclient` from feast requirements altogether.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -116,7 +116,7 @@
     "psycopg2-binary>=2.8.3,<3",
 ]
 
-MYSQL_REQUIRED = ["mysqlclient", "pymysql", "types-PyMySQL"]
+MYSQL_REQUIRED = ["pymysql", "types-PyMySQL"]
 
 HBASE_REQUIRED = [
     "happybase>=1.2.0,<3",


Test patch:
diff --git a/sdk/python/tests/unit/test_sql_registry.py b/sdk/python/tests/unit/test_sql_registry.py
--- a/sdk/python/tests/unit/test_sql_registry.py
+++ b/sdk/python/tests/unit/test_sql_registry.py
@@ -103,7 +103,7 @@ def mysql_registry():
 
     registry_config = RegistryConfig(
         registry_type="sql",
-        path=f"mysql+mysqldb://{POSTGRES_USER}:{POSTGRES_PASSWORD}@127.0.0.1:{container_port}/{POSTGRES_DB}",
+        path=f"mysql+pymysql://{POSTGRES_USER}:{POSTGRES_PASSWORD}@127.0.0.1:{container_port}/{POSTGRES_DB}",
     )
 
     yield SqlRegistry(registry_config, "project", None)