Include links in Sphinx table without extra whitespace - python-sphinx

I'm trying to create a table of links using the simple table format in Sphinx, like the example below:
=================================== ======
Website Type
=================================== ======
`Google <https://www.google.com>`__ Search
`Yahoo <https://www.yahoo.com>`__ Search
`CNN <https://www.cnn.com>`__ News
=================================== ======
If I understand correctly, I have to stretch the header breaks to the width of the longest row in the table, including the links. However, when the table is rendered the website is rendered as a link, leading to a lot of empty whitespace in the Website column.
Is there a way to create a table where the column is only as wide as the longest rendered hyperlink?

Wrapping the table in a table directive with :widths: auto works for me (tested with Sphinx 4.2.0).
.. table::
:align: left
:widths: auto
================================== ======
Website Type
================================== ======
`Google <https://www.google.com>`_ Search
`Yahoo <https://www.yahoo.com>`_ Search
`CNN <https://www.cnn.com>`_ News
================================== ======

Related

In QuickBase, is there a way to add a drilldown report to a formula field?

One thing I appreciate about QuickBase table to table relationship summary formulas is that they automatically are hyperlinked to a drilldown report (e.g., if I had a field that counted the # of passing scores for a person and the person had 2, then there's automatically a link to the parent table/report and if I click it, I can see both of that individual's passing score records).
Unfortunately, I lose that functionality when writing a formula outside of the table-to-table default options (e.g., the # of passing scores divided by the # of passing + non-passing scores does not give option to add a drilldown report). Is there a way to add drilldown to a formula field? The closest I got was adding a report link field, but it'd be nice if that was a hyperlink with a number to avoid taking unnecessary space.
You should be able to do that using a Formula Rich Text field with an HTML hyperlink and adding a query parameter in your URL. You can get some help building the query if you turn off the new report style, then going to More > Show the expanded URL for this report. The expanded URL should look like this:
I agree with the Rich text field.
I prefer to build a query instead of using the expanded one.
The expanded url has a temporary id :(
Here is an example how you can create an own link if you use a formula Rich text field.
For sure, you have to replace a couple of variables in the following link ;)
// qid=1 >> id of your drilldown report
// mx{6.TV.2} >> 6 is the related field's id, 2 is the key of your table (master)
// the numbers are just an examples
// _DBID_TEMPLATES_CHILDREN >> you can find it at bottom of the children table's
advanced settings
"<a href=\""& URLRoot() & "db/" & [_DBID_TEMPLATES_CHILDREN] & "?
a=s&qid=1&dlta=mx{6.TV.2}&opts=disprec&isDDR=1\"> "& [# of Templates childs] &" </a>"

Delete last record from flat file in blob to Azure data warehouse

I have some pipe delimited flat files in Blob storage and in each file I have a header and footer record with filename, date of extract and the number of records. I am using ADF pipeline with Polybase toload into Azure DWH. I could skip header record but unable to skip the footer. The only way I could think of is creating staging table with all varchar and load into staging and then convert the data types back into main tables. But that is not working as the number of columns is different to the footer and the data. Is there any easier way to do this? Please advise.
Polybase does not have an explicit option for removing footer rows but it does have a set of rejection options which you could potentially take advantage of. If you set your REJECT_TYPE as VALUE (rather than PERCENTAGE) and your REJECT_VALUE AS 1 you are telling Polybase to reject one row only. If your footer is in a different format to the main data rows, it will be rejected but your query should not fail.
CREATE EXTERNAL TABLE yourTable
...
<reject_options> ::=
{
| REJECT_TYPE = value,
| REJECT_VALUE = 2
Please post a simple, anonmyised example of your file with headers, columns and footers if you need further assistance.
Update: Check this blog post for information on tracking rejected rows:
https://azure.microsoft.com/en-us/blog/load-confidently-with-sql-data-warehouse-polybase-rejected-row-location/

Need to find an R function to filter and select Headlines of texts

I sadly have no experience with R Studio, probably the solution for my problem is easy.
I have a data package including 40.000 entries. The data is about newspaper Articles, their headlines and their content.
What I try to do is filter the Headlines. I only want to search for Headlines which include one specific word because I make a research of an specific topic
Does an Package exist witch can make this possible?
I tried "Sentiment Analysis", "text2vex" and Tidyverse.
So I imagine that you have a heading column in your data and a content column.
Headings Contents
H1 C1
H2 C2
...
you can use the following code to fetch the headings including a certain string:
grep('enter_your_string', Data$Headings, value=TRUE)

mariaDB fulltext search in innoDB/XtraDB

i have problem with full text search in innoDB/XtraDB engine.
i have full text on a column, some value is 1 or 2 length for example 'a' or 'aa'.
i set ft_min_word_Len=1 and show variable show me that this variable set to 1. but when i query like this i get no result :
SELECT * FROM test.t1 t where match(text) against('aa' );
but when i change table engine to aria or myisam i get result.
what is the problem ?
i want to use innodb/Xtradb , not aria.
please help me.
You should change innodb_ft_min_token_size to 1. The setting ft_min_word_Len refers to myisam tables. See "Excluded Results" section on this page of the mariaDB knowledge base site.
Also see this review of the innodb full text search feature:
...I was a bit surprised to see that the default minimum word length was less than the value of ft_min_word_len. Those legacy ft_% variables continue to apply only to MyISAM fulltext indexes, evidently. There's a new bundle of system variables to control InnoDB Fulltext...

Extract href in table with importxml in Google spreadsheet

I am trying to pull the href for each row of each table from this website:
http://www.epa.gov/region4/superfund/sites/sites.html#KY
I can pull the table information off using =IMPORTHTML(A1,"table",1) for all 7 tables, but I need the href to the site with the detailed information.
Using =IMPORTxml(A1,"//div[#class='box']") I can pull the information needed from a site like:
http://www.epa.gov/region4/superfund/sites/fedfacs/alarmyaplal.html
but I need to extract the fedfacs/alarmyaplal.html portion for each row on the original page.
I've tried using //#href, but it is not returning any results. I'm thinking it is because the data is structured in a table but I'm stuck on where to go from here.
I'm not sure about any of the Google Spreadsheet functionality, but here's an XPath to select all href attributes of the Kentucky sites (since your first link included the 'ky' anchor):
//body//a[#id='ky']/following-sibling::table[1]/tbody/tr/td[1]/strong/a/#href
This is very specific to the Kentucky table: following-sibling::table[1] means the first table node after, and at the same level of, a[#id='ky'].

Resources