Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve dosctrings for DataSources #1808

Open
wants to merge 44 commits into
base: master
Choose a base branch
from

Conversation

PProfizi
Copy link
Contributor

No description provided.

@luisaFelixSalles luisaFelixSalles force-pushed the api/api-ref-data-sources_fix_error branch from 8b85394 to 765f41d Compare October 15, 2024 10:21
@PProfizi PProfizi changed the base branch from api/api-ref-data-sources to master October 15, 2024 13:46
@BClappe BClappe force-pushed the api/api-ref-data-sources_fix_error branch from 5fd4060 to 8c05453 Compare October 15, 2024 14:18
.github/workflows/docs.yml Outdated Show resolved Hide resolved
.github/workflows/docs.yml Outdated Show resolved Hide resolved
@luisaFelixSalles luisaFelixSalles self-assigned this Oct 21, 2024
@luisaFelixSalles luisaFelixSalles force-pushed the api/api-ref-data-sources_fix_error branch from d283d5a to 3eb4157 Compare October 21, 2024 15:41
Comment on lines +307 to +309
key: Optional[str] = "",
is_domain: Optional[bool] = False,
domain_id: Optional[int] = 0,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do not think you have to use Optional here as giving them a default value makes them optional already. Plus, using Optional technically means it accepts None as a value, right? Which is not the case here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I haven't checked previous code for that in particular but it is worth checking for, because otherwise the user can call these with None and it will not work.

Comment on lines +403 to +404
key: Optional[str] = "",
result_key: Optional[str] = "",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Again for Optional

def add_upstream(self, upstream_data_sources, result_key=""):
"""Add upstream data sources.
def add_upstream(
self, upstream_data_sources: DataSources, result_key: Optional[str] = ""
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
self, upstream_data_sources: DataSources, result_key: Optional[str] = ""
self, upstream_data_sources: DataSources, result_key: str = ""

>>>
>>> # Get the path to the main result files of the DataSources object
>>> my_data_sources.result_files
[None, None]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@luisaFelixSalles that actually looks like a bug?

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.

2 participants