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

AttributeError when calling etils.eapp.better_logging #235

Closed
chicham opened this issue Nov 14, 2022 · 2 comments
Closed

AttributeError when calling etils.eapp.better_logging #235

chicham opened this issue Nov 14, 2022 · 2 comments

Comments

@chicham
Copy link
Contributor

chicham commented Nov 14, 2022

Hello,

When I am trying to use eapp.better_logging, it seems the module epy is trying to call a non-existent method is_borg

Traceback (most recent call last):
  File "<project path>/test_etils.py", line 20, in <module>
    app.run(main, flags_parser=eapp.make_flags_parser(Args))
  File "<env path>/lib/python3.9/site-packages/absl/app.py", line 306, in run
    callback()
  File "<env path>/lib/python3.9/site-packages/etils/eapp/logging_utils.py", line 64, in _better_logging
    if epy.is_borg():
AttributeError: module 'etils.epy' has no attribute 'is_borg'

Minimal code for reproducing the issue with python3.9:

import dataclasses

from absl import app
from etils import eapp


@dataclasses.dataclass
class Args:  # Define `--user=some_user --verbose` CLI flags
    user: str
    verbose: bool = False


def main(args: Args):
    if args.verbose:
        print(args.user)


if __name__ == "__main__":
    eapp.better_logging()
    app.run(main, flags_parser=eapp.make_flags_parser(Args))

Best,
Hicham

copybara-service bot pushed a commit that referenced this issue Nov 14, 2022
PiperOrigin-RevId: 488336648
@Conchylicultor
Copy link
Member

Oups, sorry about that. https://github.com/google/etils/pull/236/files should fix it

copybara-service bot pushed a commit that referenced this issue Nov 15, 2022
PiperOrigin-RevId: 488336648
@chicham
Copy link
Contributor Author

chicham commented Nov 16, 2022

Thanks a lot

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 a pull request may close this issue.

2 participants