Skip to content

Releases: civisanalytics/civis-python

v2.8.1

03 Mar 17:01
d835f15

Choose a tag to compare

Changed

  • Updated the Civis API spec in order to refresh the Sphinx docs on the Read The Docs site. (#531)

v2.8.0

26 Jan 19:28
c90c65c

Choose a tag to compare

Added

  • Added type annotations to public functions and classes. (#529)
  • Enabled static type checks with mypy on CI builds. (#529)
  • File-related civis.io.* functions that accept a path can now take either a string
    or a path-like object as the input. (#529)
  • A PaginatedResponse object now has the json() method. (#529)
  • Added support for Python 3.14. (#528)
  • Added API endpoint method and path URL in the error message of a CivisAPIError exception. (#528)

Changed

  • Updated civis.utils.run_template to accept kwargs. (#526)
  • Updated retries for Civis API calls under civis.APIClient
    to wait at least the Retry-After duration from the response header,
    instead of potentially less than that. (#525)

Deprecated

  • Deprecated the JSONValue parameter of civis.utils.run_template. (#526)
  • Some of the list* methods from various Civis API endpoints should have been named
    get*, because they return a singleton civis.Response object, as opposed to an array
    of such objects. These list* methods are now deprecated. The corresponding
    equivalent get* methods are available and should be preferred. The following
    is the full list of these list* methods and their preferred get* counterparts (#530):
    • client.clusters.list_kubernetes_instance_configs_historical_graphs -> client.clusters.get_kubernetes_instance_configs_historical_graphs
    • client.clusters.list_kubernetes_instance_configs_historical_metrics -> client.clusters.get_kubernetes_instance_configs_historical_metrics
    • client.databases.list_advanced_settings -> client.databases.get_advanced_settings
    • client.endpoints.list -> client.endpoints.get
    • client.git_repos.list_refs -> client.git_repos.get_refs
    • client.groups.list_child_groups -> client.groups.get_child_groups
    • client.models.list_schedules -> client.models.get_schedules
    • client.notebooks.list_update_links -> client.notebooks.get_update_links
    • client.notebooks.list_git -> client.notebooks.get_git
    • client.notifications.list -> client.notifications.get
    • client.predictions.list_schedules -> client.predictions.get_schedules
    • client.reports.list_git -> client.reports.get_git
    • client.scripts.list_sql_git -> client.scripts.get_sql_git
    • client.scripts.list_javascript_git -> client.scripts.get_javascript_git
    • client.scripts.list_python3_git -> client.scripts.get_python3_git
    • client.scripts.list_r_git -> client.scripts.get_r_git
    • client.usage.list_llm_organization_summary -> client.usage.get_llm_organization_summary
    • client.users.list_me -> client.users.get_me
    • client.workflows.list_git -> client.workflows.get_git

Removed

  • Dropped support for Python 3.10. (#528)

Fixed

  • Fixed civis.utils.run_template for the return value when return_as="JSONValue". (#529)
  • Fixed retries for Civis API calls under civis.APIClient
    that would lead to a recursion error. (#525)
  • Updated documentation for the preview_rows argument of civis.io.query_civis to
    have the correct maximum of 1000. (#523)

v2.7.1

03 Jul 16:47
a5cd207

Choose a tag to compare

Fixed

  • Fixed civis.APIClient in the stub file for the new user_agent keyword argument. (#522)

v2.7.0

03 Jul 15:27
24a953e

Choose a tag to compare

Added

  • Added the keyword argument user_agent to civis.APIClient. (#521)

v2.6.0

02 Jul 17:09
e515730

Choose a tag to compare

Added

  • Added the keyword argument client to civis.utils.job_logs(). (#518)
  • Implemented ListResponse as a list of civis.Response objects that has "headers"
    information from a Civis API call. (#518)
  • The civis.io.* functions for dataframes support polars in addition to pandas. (#515)
    • For civis.io.read_civis_sql and civis.io.read_civis:
      The new kwarg return_as has been added. It defaults to "list" to maintain
      the same return behavior as civis-python <= v2.5.0.
      To return a dataframe, set return_as to either "pandas" or "polars".
    • For civis.io.dataframe_to_file and civis.io.dataframe_to_civis:
      Either a pandas or polars dataframe can now be directly used as input.
    • For civis.io.file_to_dataframe:
      The new kwarg return_as has been added. It defaults to "pandas" to maintain
      the same return behavior as civis-python <= v2.5.0.
      To return a polars dataframe, set return_as to "polars".
  • Added examples to civis.utils.job_logs() docstring (#510)

Changed

  • Updated Civis parallel backend's internals for refactored joblib's backend. (#513)
  • Updated the Sphinx docs for ListResponse and the Civis API. (#519)

Deprecated

  • The kwarg use_pandas at civis.io.read_civis_sql and civis.io.read_civis
    has been deprecated and will be removed at civis-python v3.0.0 (no release timeline yet).
    Its continued usage is discouraged, and please use the new kwarg return_as instead
    (see notes under the "added" section above).
  • The property feature_flags at a civis.APIClient instance is now deprecated.
    client.users.list_me()["feature_flags"] should be used instead. (#516)

Fixed

  • Switched from a pool to the concurrent.futures API in the file multipart upload
    implementation. (#520)
  • Fixed civis_logger for needing a user-provided __name__ as best practice. (#512)

Security

v2.5.0

24 Feb 18:42
16e418a

Choose a tag to compare

Added

  • Added civis.utils.job_logs() function to return a generator of log messages for a job run (#509)

Changed

  • Revised the CLI commands civis jobs follow-log and civis jobs follow-run-log to not skip log messages for running jobs (#509)

v2.4.3

13 Jan 19:10
d515389

Choose a tag to compare

Fixed

  • Fixed the way array query parameters are passed to a Civis API call,
    so that all items in an array are included in the correctly formatted URL. (#507)

v2.4.2

02 Jan 15:01
55fe7c2

Choose a tag to compare

Changed

  • Refactored docs/ since the docs/source/ subdirectory is no longer needed. (#506)

Fixed

  • Fixed the tool for checking if the upstream Civis API spec has changed. (#505)

Security

  • In docs build, bumped the transitive dependency jinja2's version from 3.1.4 to 3.1.5,
    due to CVE-2024-56326. (#506)

v2.4.1

27 Nov 14:30
2396478

Choose a tag to compare

Changed

  • Updated the Civis API spec in order to refresh the Sphinx docs on the Read The Docs site. (#504)

v2.4.0

11 Nov 21:55
24be84d

Choose a tag to compare

Added

  • The new kwarg retries has been added to civis.APIClient so that
    a tenacity.Retrying instance can be provided to customize retries. (#495)
  • Added civis.workflows.validate_workflow_yaml
    to validate a Civis Platform workflow YAML definition. (#497, #499)
  • The helper I/O functions that create a Civis file
    (i.e., civis.io.file_to_civis, civis.io.dataframe_to_file, and civis.io.json_to_file)
    accept a new description keyword argument for the new description attribute
    of Civis file objects. (#498, #500)
  • Response objects are now fully typed through the attribute syntax. (#501)
  • Both Response and PaginatedResponse are now directly available under the civis namespace. (#501)
  • Added support for Python 3.13. (#501)
  • Added the new property default_database_credential_id at civis.APIClient,
    which is going to replace the existing default_credential. (#502)

Changed

  • When a PaginatedResponse object is returned from an API call,
    a user-specified limit kwarg is now honored to facilitate speeding up the pagination. (#501)

Deprecated

  • The method get_database_credential_id at civis.APIClient has been deprecated
    and will be removed at civis-python v3.0.0. There's no replacement for this method. (#502)
  • The property default_credential at civis.APIClient has been deprecated
    and will be removed at civis-python v3.0.0,
    in favor of the new property default_database_credential_id. (#502)

Removed

  • Dropped support for Python 3.9. (#499)

Fixed

  • The repr form of Response objects is now the dict-based Response({‘spam’: 123})
    instead of the dataclass-based Response(spam=123), since response object keys can
    be invalid Python identifiers. (#501)
  • In Response object instantiation, object keys that originate from environment variables
    are now preserved for their (customarily upper-) case even in the default snake-case setting. (#501)
  • In Response object instantiation, an API response that represents a JSONValue object
    now has its value attribute unmodified as the Python object representation
    of the deserialized JSON form (as opposed to being converted to a Response-based form). (#501)