DyfanJones / noctua

Connect R to Athena using paws SDK (DBI Interface)
https://dyfanjones.github.io/noctua/
Other
45 stars 5 forks source link

Do not abort if a get_tables fails #106

Closed OssiLehtinen closed 3 years ago

OssiLehtinen commented 3 years ago

An issue connected to the Lake Formation service in AWS appeared:

Lake Formation can be used to share content from one AWS account's glue catalog to another account.

The problem arises, when:

  1. A Lake formation share is created on account A
  2. A resource link is created on account B
  3. The share on acc A is removed leaving an 'oprhaned' resource link

Now, when a user tries to establish a noctua/Athena connection, an error occurs, as the user on account B doesn't have permission to get_tables on account B:s data catalog anymore.

This pull request makes the get_tables error tolerant so that if access is denied, an empty list of tables is put forward.

Probably the multiple tryCatche's are unnecessary now, but I hope this at least outlines the idea how one could address the issue.

Br, Ossi

DyfanJones commented 3 years ago

Hi @OssiLehtinen this logic of this makes sense. Can you apply the same logic to dbGetTables?

We probably want to add some documentation that highlights this behaviour, so that the functions are as transparent to the user.

Also do you mind adding this to the news.md section please?

I am getting ready for the next cran release to resolve issue: https://github.com/DyfanJones/noctua/issues/104 . I will hold off until this PR comes into the master branch :)

OssiLehtinen commented 3 years ago

I made a note of the fix in news.md.

The original pull request actually has a fix for dbGetTables (and dbListTables) already, sorry for not pointing those out.

DyfanJones commented 3 years ago

@OssiLehtinen ah don't worry, it was me missing the change to dbGetTables. I will merge this PR now and get the package ready for it's next cran release :)

DyfanJones commented 3 years ago

noctua_1.8.1 has been submitted to the cran.