Repository: meltano/meltano

Issue:
bug: Pytest warnings when using mssql DB backend
### Meltano Version

2.4.0

### Python Version

NA

### Bug scope

Other

### Operating System

Linux

### Description

Pytest is catching warnings emitted during testing with the mssql DB backend. Example:

https://github.com/meltano/meltano/runs/7813948143

```
/home/runner/work/meltano/meltano/.nox/tests-3-9/lib/python3.9/site-packages/alembic/ddl/mssql.py:125: UserWarning: MS-SQL ALTER COLUMN operations that specify type_= should also specify a nullable= or existing_nullable= argument to avoid implicit conversion of NOT NULL columns to NULL.
    util.warn(
```

It's the same warning being emitted 90 times.

### Code

Running a test that raises the warning with `python -Werror pytest ...` results in the following traceback:

```
Traceback (most recent call last):
  File "/home/will/meltano/meltano/src/meltano/core/migration_service.py", line 96, in upgrade
    command.upgrade(cfg, head)
  File "/home/will/.pyenv/versions/meltano3/lib/python3.7/site-packages/alembic/command.py", line 322, in upgrade
    script.run_env()
  File "/home/will/.pyenv/versions/meltano3/lib/python3.7/site-packages/alembic/script/base.py", line 569, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/home/will/.pyenv/versions/meltano3/lib/python3.7/site-packages/alembic/util/pyfiles.py", line 94, in load_python_file
    module = load_module_py(module_id, path)
  File "/home/will/.pyenv/versions/meltano3/lib/python3.7/site-packages/alembic/util/pyfiles.py", line 110, in load_module_py
    spec.loader.exec_module(module)  # type: ignore
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/will/meltano/meltano/src/meltano/migrations/env.py", line 60, in <module>
    run_migrations_online()
  File "/home/will/meltano/meltano/src/meltano/migrations/env.py", line 37, in run_migrations_online
    _run_migrations_online(connection)
  File "/home/will/meltano/meltano/src/meltano/migrations/env.py", line 54, in _run_migrations_online
    context.run_migrations()
  File "<string>", line 8, in run_migrations
  File "/home/will/.pyenv/versions/meltano3/lib/python3.7/site-packages/alembic/runtime/environment.py", line 853, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/home/will/.pyenv/versions/meltano3/lib/python3.7/site-packages/alembic/runtime/migration.py", line 623, in run_migrations
    step.migration_fn(**kw)
  File "/home/will/meltano/meltano/src/meltano/migrations/versions/13e8639c6d2b_add_state_edit_to_job_state_enum.py", line 49, in upgrade
    existing_type=sa.Enum(State, name="job_state"),
  File "<string>", line 8, in alter_column
  File "<string>", line 3, in alter_column
  File "/home/will/.pyenv/versions/meltano3/lib/python3.7/site-packages/alembic/operations/ops.py", line 1880, in alter_column
    return operations.invoke(alt)
  File "/home/will/.pyenv/versions/meltano3/lib/python3.7/site-packages/alembic/operations/base.py", line 399, in invoke
    return fn(self, operation)
  File "/home/will/.pyenv/versions/meltano3/lib/python3.7/site-packages/alembic/operations/toimpl.py", line 63, in alter_column
    **operation.kw
  File "/home/will/.pyenv/versions/meltano3/lib/python3.7/site-packages/alembic/ddl/mssql.py", line 126, in alter_column
    "MS-SQL ALTER COLUMN operations that specify type_= "
  File "/home/will/.pyenv/versions/meltano3/lib/python3.7/site-packages/alembic/util/messaging.py", line 81, in warn
    warnings.warn(msg, UserWarning, stacklevel=stacklevel)
UserWarning: MS-SQL ALTER COLUMN operations that specify type_= should also specify a nullable= or existing_nullable= argument to avoid implicit conversion of NOT NULL columns to NULL.
```


Discussion:

Resolving patch:
diff --git a/src/meltano/migrations/versions/13e8639c6d2b_add_state_edit_to_job_state_enum.py b/src/meltano/migrations/versions/13e8639c6d2b_add_state_edit_to_job_state_enum.py
--- a/src/meltano/migrations/versions/13e8639c6d2b_add_state_edit_to_job_state_enum.py
+++ b/src/meltano/migrations/versions/13e8639c6d2b_add_state_edit_to_job_state_enum.py
@@ -47,6 +47,7 @@ def upgrade():
             column_name="state",
             type_=sa.types.String(max_string_length),
             existing_type=sa.Enum(State, name="job_state"),
+            existing_nullable=True,
         )
 
     # In postgresql, drop the created Enum type so that


Test patch: