Skip to content

[Documentation Issue] Public properties are not listed in documentation #1835

Closed

Description

@ngelinas

Page Name: pubsub-subscription
Release: 0.14.0

Though the name, topic, ack_deadline and push_endpoint properties are public properties of the subscription object, this is not shown anywhere in the documentation. It is very _Pythonic_ to expose constructor properties as public properties but notating as such in the documentation would be helpful.

The same can be said for topic objects.

Activity

  1. added
    api: pubsub
    on May 30, 2016
  2. dhermes commented on Jun 7, 2016

    @dhermes
    Contributor

    @tseaver What's the cause here? Are these properties just data attributes, or do they have @property? Also, if they are just data attributes, does Sphinx have an Attributes section we could use in the class doc?

  3. tseaver commented on Jun 7, 2016

    @tseaver
    Contributor

    Defined via @property: the docstrings for the resulting descriptors are copied from their getters.

  4. tseaver commented on Jun 7, 2016

    @tseaver
    Contributor

    Oops, I spoke in haste/error: name, topic, ack_deadline, and push_endpoint are not properties. To fix this, we would need to do one of two things:

    • Make them properties, backed by private attributes.
    • Give them class-level default values with their own docstrings.
  5. tseaver commented on Jun 7, 2016

    @tseaver
    Contributor

    There is also auto-attribute syntax, which feels nicer than embedding it in the class' docstring.

  6. dhermes commented on Jun 7, 2016

    @dhermes
    Contributor

    Wow I didn't realize we could even provide instance attribute docstrings in __init__!

  7. ensonic commented on Feb 21, 2017

    @ensonic

    Friendly ping.

    dir(topic)
    ['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_client', '_require_client', '_timestamp_message', 'batch', 'check_iam_permissions', 'create', 'delete', 'exists', 'from_api_repr', 'full_name', 'get_iam_policy', 'list_subscriptions', 'name', 'project', 'publish', 'set_iam_policy', 'subscription', 'timestamp_messages']

    but still not covered in https://googlecloudplatform.github.io/google-cloud-python/stable/pubsub-topic.html

  8. lukesneeringer commented on Apr 19, 2017

    @lukesneeringer
    Contributor

    We are in the process of working on a pretty significant change to this API, so for now I would prefer not shore up docs that we are about to need to change anyway.

    I will ensure that the documentation is complete in the rehash.

  9. dhermes commented on Apr 19, 2017

    @dhermes
    Contributor

    @lukesneeringer We should probably re-open a "sub-issue" here, namely the idea that class attributes should be documented (especially if they aren't @property-s or constructor arguments)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

api: pubsub

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions