prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN 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.
  ```
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `src/meltano/migrations/versions/13e8639c6d2b_add_state_edit_to_job_state_enum.py`
  Content:
  ```
  1 """add_state_edit_to_job_state_enum
  2 
  3 Revision ID: 13e8639c6d2b
  4 Revises: d135f52a6f49
  5 Create Date: 2022-04-21 09:35:35.435614
  6 
  7 """
  8 from enum import Enum
  9 
  10 import sqlalchemy as sa
  11 from alembic import op
  12 
  13 from meltano.migrations.utils.dialect_typing import (
  14     get_dialect_name,
  15     max_string_length_for_dialect,
  16 )
  17 
  18 # revision identifiers, used by Alembic.
  19 revision = "13e8639c6d2b"
  20 down_revision = "d135f52a6f49"
  21 branch_labels = None
  22 depends_on = None
  23 
  24 
  25 # from core/job/job.py
  26 class State(Enum):
  27     """Represents status of a Job."""
  28 
  29     IDLE = (0, ("RUNNING", "FAIL"))
  30     RUNNING = (1, ("SUCCESS", "FAIL"))
  31     SUCCESS = (2, ())
  32     FAIL = (3, ("RUNNING",))
  33     DEAD = (4, ())
  34     STATE_EDIT = (5, ())
  35 
  36 
  37 def upgrade():
  38     dialect_name = get_dialect_name()
  39     max_string_length = max_string_length_for_dialect(dialect_name)
  40 
  41     conn = op.get_bind()
  42     # In sqlite, the field is already a varchar.
  43     # "ALTER COLUMN" statements are also not supported.
  44     if conn.dialect.name != "sqlite":
  45         op.alter_column(
  46             table_name="job",
  47             column_name="state",
  48             type_=sa.types.String(max_string_length),
  49             existing_type=sa.Enum(State, name="job_state"),
  50         )
  51 
  52     # In postgresql, drop the created Enum type so that
  53     # downgrade() can re-create it.
  54     if conn.dialect.name == "postgresql":
  55         conn.execute("DROP TYPE job_state;")
  56 
  57 
  58 def downgrade():
  59     conn = op.get_bind()
  60     # In sqlite, the field is already a varchar.
  61     # "ALTER COLUMN" statements are also not supported.
  62     if conn.dialect.name != "sqlite":
  63         op.alter_column(
  64             table_name="job",
  65             column_name="state",
  66             _type=sa.Enum(State, name="job_state"),
  67             existing_type=sa.types.String,
  68         )
  69
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: 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 @@
               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
  
verification_info: {"golden_diff": "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\n--- a/src/meltano/migrations/versions/13e8639c6d2b_add_state_edit_to_job_state_enum.py\n+++ b/src/meltano/migrations/versions/13e8639c6d2b_add_state_edit_to_job_state_enum.py\n@@ -47,6 +47,7 @@\n             column_name=\"state\",\n             type_=sa.types.String(max_string_length),\n             existing_type=sa.Enum(State, name=\"job_state\"),\n+            existing_nullable=True,\n         )\n \n     # In postgresql, drop the created Enum type so that\n", "issue": "bug: Pytest warnings when using mssql DB backend\n### Meltano Version\r\n\r\n2.4.0\r\n\r\n### Python Version\r\n\r\nNA\r\n\r\n### Bug scope\r\n\r\nOther\r\n\r\n### Operating System\r\n\r\nLinux\r\n\r\n### Description\r\n\r\nPytest is catching warnings emitted during testing with the mssql DB backend. Example:\r\n\r\nhttps://github.com/meltano/meltano/runs/7813948143\r\n\r\n```\r\n/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.\r\n    util.warn(\r\n```\r\n\r\nIt's the same warning being emitted 90 times.\r\n\r\n### Code\r\n\r\nRunning a test that raises the warning with `python -Werror pytest ...` results in the following traceback:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/home/will/meltano/meltano/src/meltano/core/migration_service.py\", line 96, in upgrade\r\n    command.upgrade(cfg, head)\r\n  File \"/home/will/.pyenv/versions/meltano3/lib/python3.7/site-packages/alembic/command.py\", line 322, in upgrade\r\n    script.run_env()\r\n  File \"/home/will/.pyenv/versions/meltano3/lib/python3.7/site-packages/alembic/script/base.py\", line 569, in run_env\r\n    util.load_python_file(self.dir, \"env.py\")\r\n  File \"/home/will/.pyenv/versions/meltano3/lib/python3.7/site-packages/alembic/util/pyfiles.py\", line 94, in load_python_file\r\n    module = load_module_py(module_id, path)\r\n  File \"/home/will/.pyenv/versions/meltano3/lib/python3.7/site-packages/alembic/util/pyfiles.py\", line 110, in load_module_py\r\n    spec.loader.exec_module(module)  # type: ignore\r\n  File \"<frozen importlib._bootstrap_external>\", line 728, in exec_module\r\n  File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed\r\n  File \"/home/will/meltano/meltano/src/meltano/migrations/env.py\", line 60, in <module>\r\n    run_migrations_online()\r\n  File \"/home/will/meltano/meltano/src/meltano/migrations/env.py\", line 37, in run_migrations_online\r\n    _run_migrations_online(connection)\r\n  File \"/home/will/meltano/meltano/src/meltano/migrations/env.py\", line 54, in _run_migrations_online\r\n    context.run_migrations()\r\n  File \"<string>\", line 8, in run_migrations\r\n  File \"/home/will/.pyenv/versions/meltano3/lib/python3.7/site-packages/alembic/runtime/environment.py\", line 853, in run_migrations\r\n    self.get_context().run_migrations(**kw)\r\n  File \"/home/will/.pyenv/versions/meltano3/lib/python3.7/site-packages/alembic/runtime/migration.py\", line 623, in run_migrations\r\n    step.migration_fn(**kw)\r\n  File \"/home/will/meltano/meltano/src/meltano/migrations/versions/13e8639c6d2b_add_state_edit_to_job_state_enum.py\", line 49, in upgrade\r\n    existing_type=sa.Enum(State, name=\"job_state\"),\r\n  File \"<string>\", line 8, in alter_column\r\n  File \"<string>\", line 3, in alter_column\r\n  File \"/home/will/.pyenv/versions/meltano3/lib/python3.7/site-packages/alembic/operations/ops.py\", line 1880, in alter_column\r\n    return operations.invoke(alt)\r\n  File \"/home/will/.pyenv/versions/meltano3/lib/python3.7/site-packages/alembic/operations/base.py\", line 399, in invoke\r\n    return fn(self, operation)\r\n  File \"/home/will/.pyenv/versions/meltano3/lib/python3.7/site-packages/alembic/operations/toimpl.py\", line 63, in alter_column\r\n    **operation.kw\r\n  File \"/home/will/.pyenv/versions/meltano3/lib/python3.7/site-packages/alembic/ddl/mssql.py\", line 126, in alter_column\r\n    \"MS-SQL ALTER COLUMN operations that specify type_= \"\r\n  File \"/home/will/.pyenv/versions/meltano3/lib/python3.7/site-packages/alembic/util/messaging.py\", line 81, in warn\r\n    warnings.warn(msg, UserWarning, stacklevel=stacklevel)\r\nUserWarning: 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.\r\n```\n", "before_files": [{"content": "\"\"\"add_state_edit_to_job_state_enum\n\nRevision ID: 13e8639c6d2b\nRevises: d135f52a6f49\nCreate Date: 2022-04-21 09:35:35.435614\n\n\"\"\"\nfrom enum import Enum\n\nimport sqlalchemy as sa\nfrom alembic import op\n\nfrom meltano.migrations.utils.dialect_typing import (\n    get_dialect_name,\n    max_string_length_for_dialect,\n)\n\n# revision identifiers, used by Alembic.\nrevision = \"13e8639c6d2b\"\ndown_revision = \"d135f52a6f49\"\nbranch_labels = None\ndepends_on = None\n\n\n# from core/job/job.py\nclass State(Enum):\n    \"\"\"Represents status of a Job.\"\"\"\n\n    IDLE = (0, (\"RUNNING\", \"FAIL\"))\n    RUNNING = (1, (\"SUCCESS\", \"FAIL\"))\n    SUCCESS = (2, ())\n    FAIL = (3, (\"RUNNING\",))\n    DEAD = (4, ())\n    STATE_EDIT = (5, ())\n\n\ndef upgrade():\n    dialect_name = get_dialect_name()\n    max_string_length = max_string_length_for_dialect(dialect_name)\n\n    conn = op.get_bind()\n    # In sqlite, the field is already a varchar.\n    # \"ALTER COLUMN\" statements are also not supported.\n    if conn.dialect.name != \"sqlite\":\n        op.alter_column(\n            table_name=\"job\",\n            column_name=\"state\",\n            type_=sa.types.String(max_string_length),\n            existing_type=sa.Enum(State, name=\"job_state\"),\n        )\n\n    # In postgresql, drop the created Enum type so that\n    # downgrade() can re-create it.\n    if conn.dialect.name == \"postgresql\":\n        conn.execute(\"DROP TYPE job_state;\")\n\n\ndef downgrade():\n    conn = op.get_bind()\n    # In sqlite, the field is already a varchar.\n    # \"ALTER COLUMN\" statements are also not supported.\n    if conn.dialect.name != \"sqlite\":\n        op.alter_column(\n            table_name=\"job\",\n            column_name=\"state\",\n            _type=sa.Enum(State, name=\"job_state\"),\n            existing_type=sa.types.String,\n        )\n", "path": "src/meltano/migrations/versions/13e8639c6d2b_add_state_edit_to_job_state_enum.py"}], "after_files": [{"content": "\"\"\"add_state_edit_to_job_state_enum\n\nRevision ID: 13e8639c6d2b\nRevises: d135f52a6f49\nCreate Date: 2022-04-21 09:35:35.435614\n\n\"\"\"\nfrom enum import Enum\n\nimport sqlalchemy as sa\nfrom alembic import op\n\nfrom meltano.migrations.utils.dialect_typing import (\n    get_dialect_name,\n    max_string_length_for_dialect,\n)\n\n# revision identifiers, used by Alembic.\nrevision = \"13e8639c6d2b\"\ndown_revision = \"d135f52a6f49\"\nbranch_labels = None\ndepends_on = None\n\n\n# from core/job/job.py\nclass State(Enum):\n    \"\"\"Represents status of a Job.\"\"\"\n\n    IDLE = (0, (\"RUNNING\", \"FAIL\"))\n    RUNNING = (1, (\"SUCCESS\", \"FAIL\"))\n    SUCCESS = (2, ())\n    FAIL = (3, (\"RUNNING\",))\n    DEAD = (4, ())\n    STATE_EDIT = (5, ())\n\n\ndef upgrade():\n    dialect_name = get_dialect_name()\n    max_string_length = max_string_length_for_dialect(dialect_name)\n\n    conn = op.get_bind()\n    # In sqlite, the field is already a varchar.\n    # \"ALTER COLUMN\" statements are also not supported.\n    if conn.dialect.name != \"sqlite\":\n        op.alter_column(\n            table_name=\"job\",\n            column_name=\"state\",\n            type_=sa.types.String(max_string_length),\n            existing_type=sa.Enum(State, name=\"job_state\"),\n            existing_nullable=True,\n        )\n\n    # In postgresql, drop the created Enum type so that\n    # downgrade() can re-create it.\n    if conn.dialect.name == \"postgresql\":\n        conn.execute(\"DROP TYPE job_state;\")\n\n\ndef downgrade():\n    conn = op.get_bind()\n    # In sqlite, the field is already a varchar.\n    # \"ALTER COLUMN\" statements are also not supported.\n    if conn.dialect.name != \"sqlite\":\n        op.alter_column(\n            table_name=\"job\",\n            column_name=\"state\",\n            _type=sa.Enum(State, name=\"job_state\"),\n            existing_type=sa.types.String,\n        )\n", "path": "src/meltano/migrations/versions/13e8639c6d2b_add_state_edit_to_job_state_enum.py"}]}