Skip to content

Inconsistent get_all_names API between SubsetService and ViewService #1272

@onefloid

Description

@onefloid

📖 Description

Currently, there is an inconsistency between SubsetService.get_all_names and ViewService.get_all_names:

  • SubsetService.get_all_names returns a single list, controlled via the Boolean flag private=True/False.
  • ViewService.get_all_names returns a tuple of two lists (private and public views), without a Boolean flag.

This difference in return types makes the API less consistent and can be confusing for developers using both services.


💡 Proposed Solution

  • Introduce a new parameter scope to control visibility.
  • scope can accept either a string ("private", "public", "both") or an Enum (Scope.PRIVATE, Scope.PUBLIC, Scope.BOTH).
  • Keep the old private=True/False parameter for backward compatibility.
  • Return values:
    • "private" or "public" → list of names
    • "both" → tuple (private_list, public_list)

Benefit: consistent API for subsets and views, clear visibility control, flexible and extensible.


📝 Example Usage

# Subsets
subsets.get_all_names("Account", scope="private")   # list
subsets.get_all_names("Account", scope="both")      # tuple

# Views
views.get_all_names("SalesCube", scope="public")    # list
views.get_all_names("SalesCube", scope="both")      # tuple

I look forward to your feedback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions