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

fix: use isinstance() instead of hasattr() #434

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

rich-iannone
Copy link
Member

In #348 we wanted to ensure that the signature of tab_spanner() has been updated with types that indicate md() and html() could be used in the label= argument. This was done in a previous PR.

A second requirement was update the logic to use isinstance() checks rather than hasattr(). That change was made in this PR.

Fixes: #348

Copy link

codecov bot commented Sep 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.37%. Comparing base (11660a6) to head (fe684d4).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #434   +/-   ##
=======================================
  Coverage   86.37%   86.37%           
=======================================
  Files          42       42           
  Lines        4683     4683           
=======================================
  Hits         4045     4045           
  Misses        638      638           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@machow
Copy link
Collaborator

machow commented Sep 9, 2024

Can you show that #348 is resolved? (either by pointing to tests or creating examples)

  • If md() is passed is it handled as expected? (e.g. does the markdown get rendered)
  • If html() is passed is it handled as expected? (e.g. does the html get rendered)
  • If text is passed that looks like html, it should not get rendered as html (if this is happening, even if we close issue 348 we should track this bug; but also we may have an issue open for this already?)

I'm surprised that we could simply grab the text our so that md() and html() is a no-op

@machow
Copy link
Collaborator

machow commented Sep 9, 2024

I got this so wrong 😭 -- these changes are for handling id, which is the unique name for referring to the spanner. But label display is handled later on in the code (https://github.com/posit-dev/great-tables/pull/434/files#diff-b4c74a432c9ffd70ea3c383684233bfdea5f3bac27dacab684be0c3a4e9cffb5L190).

@rich-iannone rich-iannone marked this pull request as ready for review September 9, 2024 22:12
@rich-iannone rich-iannone merged commit e877444 into main Sep 9, 2024
13 checks passed
@rich-iannone rich-iannone deleted the fix-tab-spanner-signature-update branch September 9, 2024 22:12
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.

Update signature for tab_spanners to indicate label can be md(), html() result
2 participants