Skip to content

Conversation

@JCZuurmond
Copy link
Contributor

@JCZuurmond JCZuurmond commented Sep 23, 2024

Changes

Add name parameter to make_catalog fixture.

Tests

  • added unit tests

@JCZuurmond JCZuurmond self-assigned this Sep 23, 2024
@JCZuurmond JCZuurmond requested a review from nfx as a code owner September 23, 2024 08:41
@github-actions
Copy link

github-actions bot commented Sep 23, 2024

This PR breaks backwards compatibility for databrickslabs/blueprint downstream. See build logs for more details.

Running from downstreams #38

@github-actions
Copy link

github-actions bot commented Sep 23, 2024

✅ 35/35 passed, 3 skipped, 1m49s total

Running from acceptance #79

Copy link
Contributor

@asnare asnare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's great that this is here, although I think some changes are needed to match the conventions we're using for other fixtures.


def create() -> CatalogInfo:
name = f"dummy_C{make_random(4)}".lower()
def create(name: str = "") -> CatalogInfo:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The convention for create() methods is:

  • Keyword-only arguments.
  • A default of None if they're optional.
  • catalog_name instead of name (for better composability).

The argument also needs to be described in the docstring for make_catalog above to ensure that it ends up in the project documentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name -> catalog_name is not similar to make_schema

@JCZuurmond JCZuurmond force-pushed the feature/add-name-to-make-catalog branch from 4e42570 to 600ad0c Compare September 23, 2024 11:03
@JCZuurmond JCZuurmond requested a review from asnare September 23, 2024 12:32
Copy link
Contributor

@asnare asnare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Collaborator

@nfx nfx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@nfx nfx merged commit 260b2c9 into main Sep 23, 2024
8 of 9 checks passed
@nfx nfx deleted the feature/add-name-to-make-catalog branch September 23, 2024 13:12
nfx added a commit that referenced this pull request Sep 23, 2024
* Support providing name in `make_catalog` fixture ([#52](#52)). The `make_catalog` fixture in our open-source library has been updated to allow users to specify a name for the catalog using a new `name` parameter. Previously, the catalog was given a random name, but now users can have more control and customization over catalog names in their tests. This change includes updates to the docstring and the addition of unit tests to ensure the fixture behaves as expected with the new parameter. Additionally, the underlying `call_stateful` function was updated to expect a callable that returns a generator of callables, enabling the support for providing a name. The `test_make_catalog_creates_catalog_with_name` and `test_make_catalog` tests have been added to verify the behavior of the fixture with the new `name` parameter.
@nfx nfx mentioned this pull request Sep 23, 2024
nfx added a commit that referenced this pull request Sep 23, 2024
* Support providing name in `make_catalog` fixture
([#52](#52)). The
`make_catalog` fixture in our open-source library has been updated to
allow users to specify a name for the catalog using a new `name`
parameter. Previously, the catalog was given a random name, but now
users can have more control and customization over catalog names in
their tests. This change includes updates to the docstring and the
addition of unit tests to ensure the fixture behaves as expected with
the new parameter. Additionally, the underlying `call_stateful` function
was updated to expect a callable that returns a generator of callables,
enabling the support for providing a name. The
`test_make_catalog_creates_catalog_with_name` and `test_make_catalog`
tests have been added to verify the behavior of the fixture with the new
`name` parameter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants