Issue 1:
We need the equivalent of #20770 for the case of partial indexing (which includes both indexing by lists of partial keys, and indexing by specifying a list for each level). It needs a separate approach because resulting indexers are different (as missing keys are dropped rather than replaced with NaN).

In [2]: mi = pd.MultiIndex.from_product([[1, 2], [3,4]])

In [3]: s = pd.Series(-1, index=mi)

In [4]: s.loc[[1, 3],[3, 4]]
Out[4]:
1 3 -1
4 -1
dtype: int64

In any case, as for #20770, it should be possible to emit the warning without checking a second (or first) time for absent keys.

Output of pd.show_versions()

INSTALLED VERSIONS

commit: c4da79b

python: 3.5.3.final.0

python-bits: 64

OS: Linux

OS-release: 4.9.0-6-amd64

machine: x86_64

processor:

byteorder: little

LC_ALL: None

LANG: it_IT.UTF-8

LOCALE: it_IT.UTF-8

pandas: 0.23.0.dev0+824.gc4da79b5b.dirty

pytest: 3.5.0

pip: 9.0.1

setuptools: 39.0.1

Cython: 0.25.2

numpy: 1.14.1

scipy: 0.19.0

pyarrow: None

xarray: None

IPython: 6.2.1

sphinx: 1.5.6

patsy: 0.5.0

dateutil: 2.7.0

pytz: 2017.2

blosc: None

bottleneck: 1.2.0dev

tables: 3.3.0

numexpr: 2.6.1

feather: 0.3.1

matplotlib: 2.0.0

openpyxl: 2.3.0

xlrd: 1.0.0

xlwt: 1.3.0

xlsxwriter: 0.9.6

lxml: 4.1.1

bs4: 4.5.3

html5lib: 0.999999999

sqlalchemy: 1.0.15

pymysql: None

psycopg2: None

jinja2: 2.10

s3fs: None

fastparquet: None

pandas_gbq: None

pandas_datareader: 0.2.1

Issue 2:
This is similar to #9697, which was fixed in 0.16.1. I give a (very) slightly modified example here to show some related behavior which is at least inconsistent and should probably be handled cleanly.

It's not entirely clear to me what the desired behavior is in this case; it's possible that transform should not work here at all, since it spits out unexpected values. But at minimum it seems like it should do the same thing no matter how I invoke it below.

Example:

import numpy as np
df = pd.DataFrame({'col1':[1,1,2,2], 'col2':[1,2,3,np.nan])
#Let's try grouping on 'col2', which contains a NaN.

# Works and gives arguably reasonable results, with one unpredictable value
df.groupby('col2').transform(sum)['col1']

# Throws an unhelpful error
df.groupby('col2')['col1'].transform(sum)

Error is similar to the one encountered in the previous issue:

---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-54-2d4b83df6487> in <module>()
----> 1 df.groupby('col2')['col1'].transform(sum)

/usr/local/lib/python2.7/dist-packages/pandas/core/groupby.pyc in transform(self, func, *args, **kwargs)
2442 cyfunc = _intercept_cython(func)
2443 if cyfunc and not args and not kwargs:
-> 2444 return self._transform_fast(cyfunc)
2445
2446 # reg transform

/usr/local/lib/python2.7/dist-packages/pandas/core/groupby.pyc in _transform_fast(self, func)
2488 values = self._try_cast(values, self._selected_obj)
2489
-> 2490 return self._set_result_index_ordered(Series(values))
2491
2492 def filter(self, func, dropna=True, *args, **kwargs):

/usr/local/lib/python2.7/dist-packages/pandas/core/groupby.pyc in _set_result_index_ordered(self, result)
503 result = result.sort_index()
504
--> 505 result.index = self.obj.index
506 return result
507

/usr/local/lib/python2.7/dist-packages/pandas/core/generic.pyc in __setattr__(self, name, value)
2159 try:
2160 object.__getattribute__(self, name)
-> 2161 return object.__setattr__(self, name, value)
2162 except AttributeError:
2163 pass

/usr/local/lib/python2.7/dist-packages/pandas/lib.so in pandas.lib.AxisProperty.__set__ (pandas/lib.c:42548)()

/usr/local/lib/python2.7/dist-packages/pandas/core/series.pyc in _set_axis(self, axis, labels, fastpath)
273 object.__setattr__(self, '_index', labels)
274 if not fastpath:
--> 275 self._data.set_axis(axis, labels)
276
277 def _set_subtyp(self, is_all_dates):

/usr/local/lib/python2.7/dist-packages/pandas/core/internals.pyc in set_axis(self, axis, new_labels)
2217 if new_len != old_len:
2218 raise ValueError('Length mismatch: Expected axis has %d elements, '
-> 2219 'new values have %d elements' % (old_len, new_len))
2220
2221 self.axes[axis] = new_labels

ValueError: Length mismatch: Expected axis has 3 elements, new values have 4 elements