Autoinstall early-commands detecting existing partitions

What is the correct way on 20.04 to determine the “type” of partition that currently is present ?
I desire to see if /dev/sda1 is ext4 or “not” bios_grub and mount it to grab files off before install.
Same with /dev/sda2 “not” being a swap partition before tying to mount it and grab files.

I found “parted -l” but that is only half the issue - I tells me bios_grub or not - but there is no information on the swap partition that I see.

So how do I tell if a partition is bios_grub or swap before trying to mount? It seems mounting a swap gave errors and the installer FAILS at that point.

Thanks,

Jerry